You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: we should not attach descendent nested build task if there is no system property flags
4
4
// TODO: Support older values as well (USE_NOKEE_VERSION, use-nokee-version, wrapper system property as well) with warning
5
5
6
-
==Nokee version provider
6
+
= Nokee Deep Integration with Gradle
7
7
8
-
The init plugins will source the Nokee version from various places:
9
-
1- (persistant) From within `buildSrc` or included build -> useful when building plugins against Nokee API
8
+
To ensure an exceptional integration of the Nokee plugins with Gradle, we use an init script.
9
+
Init script -> bootstrap (least work possible) (local project or system-wide)
10
+
Init plugin -> deep gradle integration, version detection, repository configuration, wrapper enhancement (later build-init templates).
11
+
Nokee plugins -> profits
12
+
13
+
A project is said to be Nokee enabled if a Nokee version is detected, see section on nokee version detection.
14
+
15
+
== Usage
16
+
17
+
Copy the init script to your home `~/.gradle/init.d` directory.
18
+
You can also use the script via command line using `--init-script` (or `-I`). (less preferable)
19
+
20
+
== Tasks
21
+
22
+
=== Nokee Task
23
+
entry point for querying information.
24
+
Use CLI flag to control it's behaviour and query.
25
+
See Nokee task CLI flags.
26
+
27
+
--show-help::
28
+
Print helpful information on what the `nokee` task can do for you.
29
+
30
+
--show-version (`-Dshow-version`)::
31
+
Show the Nokee version detected for the build.
32
+
Due to a limitation in Gradle, use the System property flag alternative `-Dshow-version` to query the Nokee version of included builds.
33
+
34
+
--use-version::
35
+
Write a temporary version file to use instead of the version provided inside the `gradle-wrapper.properties`.
36
+
See version detection priority for more information.
37
+
38
+
=== Wrapper Task
39
+
The init plugin will patch the Wrapper task to allow for additional wrapper task configuration.
40
+
It does three additional things after the wrapper task finish executing if it detects Nokee usage:
41
+
1- Writes the nokee.init.script to the project (by default in `gradle/nokee.init.gradle`
42
+
2- Patches the wrapper scripts to implicitly pass the init script writen at one on every invocation using `--init-script` flag
43
+
3- Adds configured Nokee version to the `gradle-wrapper.properties` file.
44
+
45
+
We add an extension named `nokee` that control the wrapper enhancement:
46
+
47
+
version::
48
+
Configure to the version to use. This version will be writen to the wrapper properties.
49
+
By default the version is set to what we detected according to version detection (see section)
50
+
The Nokee version to use can be overridden using the `nokee-version` system property or Gradle property.
51
+
+
52
+
For example: `$ ./gradlew wrapper -Dnokee-version=0.4.0` will generate a wrapper using Nokee version 0.4.0 by writing the version into the `gradle-wrapper.properties` file.
53
+
Upon the next execution, the version will be considered according to the version detection order (see section).
54
+
55
+
initScriptFile::
56
+
Location where to write the nokee.init.gradle file, defaults to `gradle/nokee.init.gradle`.
2- System property `nokee-version`, i.e. `./gradlew -Dnokee-version=0.4.0 nokee --show-version`.
83
+
84
+
WARNING: Avoid setting this value in your global `gradle.properties`.
85
+
86
+
3- Gradle property `nokee-version`, i.e. `./gradlew -Pnokee-version=0.4.0 nokee --show-version`.
87
+
88
+
WARNING: Avoid setting this value in your global `gradle.properties`.
89
+
90
+
NOTE: Prefer `NOKEE_VERSION` environment variable to Gradle's long form property setting through environment variable, e.g. `ORG_GRADLE_PROJECT_nokee-version`. It's shorter.
5- Temporary version file, i.e. `./gradlew nokee --use-version=0.4.0` (or manually via `echo "0.4.0" > .gradle/nokee-version.txt`)
50
107
108
+
6- Gradle wrapper properties, e.g. `nokeeVersion` property in `gradle/wrapper/gradle-wrapper.properties`.
51
109
52
110
== Deprecation notice
111
+
Previous Nokee init plugins were using slightly different System/Gradle property, environment variable, and file names.
112
+
Please use the official names mentioned in the version detection section.
53
113
Previous values are deprecated and should no longer be used:
54
-
- use-nokee-version System/Gradle property use nokee-version instead
55
-
- USE_NOKEE_VERSION environment variable use NOKEE_VERSION instead
56
-
- .gradle/use-nokee-version.txt cache file use .gradle/nokee-version.txt
114
+
- Instead of `use-nokee-version` System/Gradle property use `nokee-version`,
115
+
- Instead of `USE_NOKEE_VERSION` environment variable use `NOKEE_VERSION`, and
116
+
- Instead of `.gradle/use-nokee-version.txt` cache file use `.gradle/nokee-version.txt`.
57
117
58
-
59
-
useNokeeVersionFromWrapper was included in Gradle wrapper, just regenerate the wrapper
118
+
Previous Nokee init plugins were injecting the Nokee version as a System property (e.g. `useNokeeVersionFromWrapper`) directly inside the generated wrapper.
119
+
To migrate, simply regenerate the Gradle wrapper: `./gradlew wrapper`
60
120
61
121
[[bintray-deprecation]]
62
122
== Bintray deprecation
@@ -67,3 +127,18 @@ We are committed to offering our plugins without interruption.
67
127
We already migrated all of our artifacts to our repositories.
68
128
Unfortunately, the Nokee init plugin does not yet provide auto-updating functionally for the init bootstrapping script.
69
129
You will need to use the link:nokee.init.gradle[latest version].
130
+
131
+
[[runtime-conflict]]
132
+
== Runtime Plugin Conflict
133
+
Under unfortunate circumstance, Gradle can end up appling multiple distinct Nokee init plugins.
134
+
We try our best to recover from such scenario by soft-disabling the extra plugins.
135
+
However, in some scenarios, it may not be possible to disalbe the extra plugins which will most likely result in a runtime failure.
136
+
It is important to solve this issue by updating all Nokee init script to its link:nokee.init.gradle[latest version].
137
+
138
+
[[troubleshooting]]
139
+
== Troubleshooting
140
+
141
+
We try our best to workaround possible failure cases.
142
+
However, usage in the wild my differ from the use cases we test in our labs.
143
+
Before opening an issue, please try upgrading all Nokee init script to its link:nokee.init.gradle[latest version].
144
+
If the upgrade doesn't solve your issue, please link:https://github.com/nokeedev/init.nokee.dev/issues[open a new issue], and we will fix it for everyone.
0 commit comments