@nx/gradle 19.0.0-rc.0 → 19.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/gradle",
3
- "version": "19.0.0-rc.0",
3
+ "version": "19.0.0-rc.2",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Gradle allows Gradle tasks to be run through Nx",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "migrations": "./migrations.json"
34
34
  },
35
35
  "dependencies": {
36
- "@nx/devkit": "19.0.0-rc.0"
36
+ "@nx/devkit": "19.0.0-rc.2"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
@@ -17,22 +17,21 @@ function getCiCommands(ci, mainBranch) {
17
17
  }
18
18
  async function ciWorkflowGenerator(tree, schema) {
19
19
  const ci = schema.ci;
20
- const nxJson = (0, devkit_1.readNxJson)(tree);
21
- const nxCloudUsed = (0, nx_cloud_utils_1.isNxCloudUsed)(nxJson);
22
- if (!nxCloudUsed) {
23
- throw new Error('This workspace is not connected to Nx Cloud.');
24
- }
25
- const options = getTemplateData(schema, nxJson);
20
+ const options = getTemplateData(tree, schema);
26
21
  (0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files', ci), '', options);
27
22
  await (0, devkit_1.formatFiles)(tree);
28
23
  }
29
24
  exports.ciWorkflowGenerator = ciWorkflowGenerator;
30
- function getTemplateData(options, nxJson) {
25
+ function getTemplateData(tree, options) {
31
26
  const { name: workflowName, fileName: workflowFileName } = (0, devkit_1.names)(options.name);
32
27
  const packageManager = (0, devkit_1.detectPackageManager)();
33
28
  const { exec: packageManagerPrefix } = (0, devkit_1.getPackageManagerCommand)(packageManager);
34
- const nxCloudUrl = (0, nx_cloud_utils_1.getNxCloudUrl)(nxJson);
35
- const nxCloudHost = new URL(nxCloudUrl).host;
29
+ let nxCloudHost = 'nx.app';
30
+ try {
31
+ const nxCloudUrl = (0, nx_cloud_utils_1.getNxCloudUrl)((0, devkit_1.readJson)(tree, 'nx.json'));
32
+ nxCloudHost = new URL(nxCloudUrl).host;
33
+ }
34
+ catch { }
36
35
  const mainBranch = (0, default_base_1.deduceDefaultBase)();
37
36
  const commands = options.commands ?? getCiCommands(options.ci, mainBranch);
38
37
  return {