Skip to content

Commit

Permalink
Upgraded Gradle Tooling API to 8.0-rc-1 (#5240)
Browse files Browse the repository at this point in the history
* Upgraded Gradle Tooling API to 8.0-rc-1

* Fixed jar task property removal in Gradle 8.0

* Deprecate no-rebuild Gradle option.

* Use Gradle 7.5 for micronaut tests

* Set Gradle 7.5 for some sensitive test projects

* Use Gradle 7.5 for Micronaut tests
  • Loading branch information
lkishalmi authored Jan 10, 2023
1 parent 19fa823 commit bc4d6fb
Show file tree
Hide file tree
Showing 24 changed files with 91 additions and 21 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ derby.log
/extide/gradle/release/modules/gradle/daemon-loader/.gradle/
/nbbuild/misc/prepare-bundles/target/

# Gradle Unittest Data
/extide/gradle/test/unit/data/**/build/
/extide/gradle/test/unit/data/**/.gradle/
/java/gradle.java/test/unit/data/**/build/
/java/gradle.java/test/unit/data/**/.gradle/
/enterprise/micronaut/test/unit/data/**/build/
/enterprise/micronaut/test/unit/data/**/.gradle/

# ANTLR v4 Grammar
##################################
/java/languages.antlr/external/*.g4
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 3 additions & 0 deletions extide/gradle/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ source.reference.netbeans-gradle-tooling.jar=netbeans-gradle-tooling/src/main/gr
test-unit-sys-prop.test.netbeans.dest.dir=${netbeans.dest.dir}
test-unit-sys-prop.java.awt.headless=true

# Enable Gradle execution exception logging during tests
#test-unit-sys-prop.org.netbeans.modules.gradle.level=FINE

release.build/tooling/netbeans-gradle-tooling.jar=modules/gradle/netbeans-gradle-tooling.jar
release.build/tooling/nb-tooling.gradle=modules/gradle/nb-tooling.gradle

Expand Down
4 changes: 2 additions & 2 deletions extide/gradle/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
<code-name-base>org.netbeans.modules.libs.gradle</code-name-base>
<compile-dependency/>
<run-dependency>
<release-version>7</release-version>
<specification-version>7.4.1</specification-version>
<release-version>8</release-version>
<specification-version>8.0.1</specification-version>
</run-dependency>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,17 @@ private void detectArtifacts(NbProjectInfoModel model) {
}
}
Map<String, Object> archives = new HashMap<>();
project.getTasks().withType(Jar.class).forEach(jar -> {
archives.put(jar.getClassifier(), jar.getArchivePath());
beforeGradle("5.2", () -> {
// The jar.getCassifier() and jar.getArchievePath() are deprecated since 5.2
// These methods got removed in 8.0
project.getTasks().withType(Jar.class).forEach(jar -> {
archives.put(jar.getClassifier(), jar.getArchivePath());
});
});
sinceGradle("5.2", () -> {
project.getTasks().withType(Jar.class).forEach(jar -> {
archives.put(jar.getArchiveClassifier().get(), jar.getDestinationDirectory().file(jar.getArchiveFileName().get()).get().getAsFile());
});
});
model.getInfo().put("archives", archives);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public enum Flag implements GradleOptionItem {
NO_CONFIGURE_ON_DEMAND(PARAM, "--no-configure-on-demand"),
NO_DAEMON(UNSUPPORTED, "--no-daemon"),
NO_PARALLEL(PARAM, "--no-parallel"),
NO_REBUILD(PARAM, "-a", "--no-rebuild"),
NO_REBUILD(PARAM, GradleVersionRange.until("8.0"), "-a", "--no-rebuild"),
NO_SCAN(PARAM, GradleVersionRange.from("4.3"), "--no-scan"),
NO_SEARCH_UPWARD(UNSUPPORTED, GradleVersionRange.until("5.0"), "--no-search-upward", "-u"),
NO_WATCH_FS(PARAM, GradleVersionRange.from("6.7"), "--no-watch-fs"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
GradleExecutorOptionsPanel.lbTasks.text=Gradle Command:
GradleExecutorOptionsPanel.jScrollPane1.TabConstraints.tabTitle=Edit
GradleExecutorOptionsPanel.jScrollPane2.TabConstraints.tabTitle=Preview
ExecutionOptionsPanel.cbNoRebuild.text=Do not Rebuild Project Dependencies
ExecutionOptionsPanel.cbNoRebuild.text=<html><strike>Do not Rebuild Project Dependencies</strike>
ExecutionOptionsPanel.cbSkipCheck.text=Skip 'check' for non-test Related Executions
ExecutionOptionsPanel.cbSkipTest.text=Skip 'test' for non-test Related Executions
ExecutionOptionsPanel.cbOffline.text=Offline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void initComponents() {
.addComponent(cbSkipCheck))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cbNoRebuild)
.addComponent(cbNoRebuild, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cbSkipTest))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ SettingsPanel.cbBundledLoading.text=Load Projects in Bundles
SettingsPanel.cbBundledLoading.toolTipText=Instead of loading sub-projects of a multi-project build individually, try fetch the sub-project details in one run.
SettingsPanel.cbUseConfigCache.toolTipText=<html>This is an <b>incubating</b> feature. Use with care!
SettingsPanel.cbUseConfigCache.text=Use Configuration Cache
SettingsPanel.cbNoRebuild.text=Do not Rebuild Project Dependencies
SettingsPanel.cbNoRebuild.toolTipText=<html>Useful for debugging and fine-tuning buildSrc, but <b>can lead to wrong results</b>.<br/>Use with caution!
SettingsPanel.cbNoRebuild.text=<html><strike>Do not Rebuild Project Dependencies</strike>
SettingsPanel.cbNoRebuild.toolTipText=<html>This option was removed in Gradle 8.0 as this <b>can lead to wrong results</b>.<br/>\nNetBeans is going to remove it in version 20.<br/>Use with caution!
SettingsPanel.jLabel2.text=Network Proxy:
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cbOffline)
.addComponent(cbConfigureOnDemand)
.addComponent(cbNoRebuild))
.addComponent(cbNoRebuild, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 162, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cbUseConfigCache)
Expand All @@ -390,7 +390,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cbSkipTest)
.addComponent(cbNoRebuild))
.addComponent(cbNoRebuild, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cbConfigureOnDemand)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,28 @@ public String getGradleVersion() {
return getPreferences().get(PROP_GRADLE_VERSION, GradleVersion.current().getVersion());
}

/**
* Gradle removed this option in version 8.0. NetBeans is going to remove
* the UI option in NetBeans 20, beyond that point this option would be
* available to keep binary compatibility, but would be un-effective.
*
* @param b
* @deprecated Do not use, could produce undesirable results.
*/
@Deprecated
public void setNoRebuild(boolean b) {
getPreferences().putBoolean(PROP_OPT_NO_REBUILD, b);
}

/**
* Gradle removed this option in version 8.0. NetBeans is going to remove
* the UI option in NetBeans 20, beyond that point this option would be
* available to keep binary compatibility, but would return {@code false}.
*
* @return whether the {@code --no-rebuild} command line option should be set by default.
* @deprecated Do not use, could produce undesirable results.
*/
@Deprecated
public boolean getNoRebuild() {
return getPreferences().getBoolean(PROP_OPT_NO_REBUILD, false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion extide/libs.gradle/external/binaries-list
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.

18FB51FF62486D84F7B91F171D0E4AABF020DCDC https://repo.gradle.org/public/org/gradle/gradle-tooling-api/7.5/gradle-tooling-api-7.5.jar gradle-tooling-api-7.5.jar
21A1F0E6F9FB1A08D06602737FF2010288F9E934 https://repo.gradle.org/artifactory/libs-releases/org/gradle/gradle-tooling-api/8.0-rc-1/gradle-tooling-api-8.0-rc-1.jar gradle-tooling-api-8.0-rc-1.jar
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: Gradle Wrapper
Description: Gradle Tooling API
Version: 7.5
Files: gradle-tooling-api-7.5.jar
Version: 8.0-rc-1
Files: gradle-tooling-api-8.0-rc-1.jar
License: Apache-2.0
Origin: Gradle Inc.
URL: https://gradle.org/
Expand Down
4 changes: 2 additions & 2 deletions extide/libs.gradle/manifest.mf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.libs.gradle/7
OpenIDE-Module: org.netbeans.modules.libs.gradle/8
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/libs/gradle/Bundle.properties
OpenIDE-Module-Specification-Version: 7.7
OpenIDE-Module-Specification-Version: 8.0.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Signature file v4.1
#Version 7.6
#Version 8.0.1

CLSS public abstract interface java.io.Serializable

Expand Down Expand Up @@ -33,6 +33,8 @@ meth public boolean isBuildCacheDebugLogging()
meth public boolean isBuildCacheEnabled()
meth public boolean isBuildProjectDependencies()
meth public boolean isBuildScan()
meth public boolean isConfigurationCacheRequested()
anno 0 org.gradle.api.Incubating()
meth public boolean isConfigureOnDemand()
anno 0 org.gradle.api.Incubating()
meth public boolean isContinueOnFailure()
Expand Down
2 changes: 1 addition & 1 deletion extide/libs.gradle/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ javac.compilerargs=-Xlint -Xlint:-serial
# For more information, please see http://wiki.netbeans.org/SignatureTest
sigtest.gen.fail.on.error=false

release.external/gradle-tooling-api-7.5.jar=modules/gradle/gradle-tooling-api.jar
release.external/gradle-tooling-api-8.0-rc-1.jar=modules/gradle/gradle-tooling-api.jar
2 changes: 1 addition & 1 deletion extide/libs.gradle/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</public-packages>
<class-path-extension>
<runtime-relative-path>gradle/gradle-tooling-api.jar</runtime-relative-path>
<binary-origin>external/gradle-tooling-api-7.5.jar</binary-origin>
<binary-origin>external/gradle-tooling-api-8.0-rc-1.jar</binary-origin>
</class-path-extension>
</data>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions java/gradle.test/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<code-name-base>org.netbeans.modules.libs.gradle</code-name-base>
<compile-dependency/>
<run-dependency>
<release-version>7</release-version>
<specification-version>7.0</specification-version>
<release-version>8</release-version>
<specification-version>8.0.1</specification-version>
</run-dependency>
</dependency>
<dependency>
Expand Down

0 comments on commit bc4d6fb

Please sign in to comment.