Skip to content

Commit

Permalink
feat(gradle): change group name to dev.nx
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Jan 26, 2025
1 parent c0f7978 commit 6827ba3
Show file tree
Hide file tree
Showing 18 changed files with 197 additions and 66 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = "io.nx"
group = "dev.nx"

plugins {
id("io.nx.gradle.native") version("+")
// id("dev.nx.gradle.native") version("+")
}

allprojects {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 4 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
9 changes: 6 additions & 3 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@
]
},
"release": {
"projects": ["packages/*", "packages/nx/native-packages/*"],
"projects": [
"packages/*",
"packages/nx/native-packages/*",
"packages/gradle/native/*"
],
"releaseTagPattern": "{version}",
"changelog": {
"workspaceChangelog": {
Expand Down Expand Up @@ -240,8 +244,7 @@
"serveStaticTargetName": "serve-static"
}
},
"@nx/powerpack-enterprise-cloud",
"@nx/gradle/plugin-v1"
"@nx/powerpack-enterprise-cloud"
],
"nxCloudId": "62d013ea0852fe0a2df74438",
"nxCloudUrl": "https://staging.nx.app",
Expand Down
4 changes: 2 additions & 2 deletions packages/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = "io.nx"
group = "dev.nx"

plugins {
id("io.nx.gradle.native") version("+")
// id("dev.nx.gradle.native") version("+")
}

allprojects {
Expand Down
4 changes: 2 additions & 2 deletions packages/gradle/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = "io.nx"
group = "dev.nx"

plugins {
id("io.nx.gradle.native") version("+")
// id("dev.nx.gradle.native") version("+")
}

allprojects {
Expand Down
62 changes: 62 additions & 0 deletions packages/gradle/native/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# dev.nx.gradle.native

This gradle plugin contains

## Installation

Kotlin
build.gradle.kts

```
plugins {
id("dev.nx.gradle.native") version("+")
}
```

Groovy
build.gradle

```
plugins {
id "dev.nx.gradle.native" version "+"
}
```

## Usage

```bash
./gradlew :createNodes
```

With specific output directory (default to `.nx/cache`):

```bash
./gradlew :createNodes --outputDirectory ./
```

With specific nx workspace root (default to current working directory):

```bash
./gradlew :createNodes --workspaceRoot ./
```

In terminal, it should output something like:

```
> Task :createNodes
<your workspace>/.nx/cache/add-nx-to-gradle.json
```

It generates a json file to be consumed by nx:

```json
{
"nodes": {
"app": {
"targets": {}
}
},
"dependencies": [],
"externalNodes": {}
}
```
12 changes: 6 additions & 6 deletions packages/gradle/native/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = "io.nx.gradle"
group = "dev.nx.gradle"

/*
* This file was generated by the Gradle 'init' task.
* This file was generated by the Gradle "init" task.
*
* This generated file contains a sample Gradle plugin project to get you started.
* For more details on writing Custom Plugins, please refer to https://docs.gradle.org/8.5/userguide/custom_plugins.html in the Gradle documentation.
Expand All @@ -14,8 +14,8 @@ plugins {
`maven-publish`
id("com.gradle.plugin-publish") version "1.3.0"

// id("java-library")
// id("org.jetbrains.kotlin.jvm") version "2.0.21"
id("java-library")
id("org.jetbrains.kotlin.jvm") version "2.0.21"

// Apply the Kotlin JVM plugin to add support for Kotlin.
// alias(libs.plugins.jvm)
Expand All @@ -32,8 +32,8 @@ gradlePlugin {
// Define the plugin
plugins {
create("nxGradleNodesPlugin") {
id = "io.nx.gradle.native"
implementationClass = "io.nx.gradle.native.Nodes"
id = "dev.nx.gradle.native"
implementationClass = "dev.nx.gradle.native.Nodes"
displayName = "The Nx Plugin for Gradle to generate nodes, dependencies and external nodes"
description = "A plugin to generate a json file with nodes, dependencies and external nodes for Nx"
tags = listOf("nx", "monorepo", "javascript", "typescript")
Expand Down
4 changes: 4 additions & 0 deletions packages/gradle/native/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "gradle-native-plugin",
"$schema": "node_modules/nx/schemas/project-schema.json"
}
Loading

0 comments on commit 6827ba3

Please sign in to comment.