bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
528 stars 306 forks source link

gradle: 3.4.0 break existing setup #2102

Closed fhuberts closed 7 years ago

fhuberts commented 7 years ago

The 3.4.0 bnd gradle plugin breaks my existing workspace setup. My workspace is here: https://github.com/fhuberts/bndtoolsWorkspace, but replace all bnd jars in it with their 3.4.0 versions to reproduce it.

Please fix.

This is not the first time a new release breaks existing setups, please try not to do that.

$ gradle

FAILURE: Build failed with an exception.

* Where:
Script '/home/ferry/vcs/x/cnf/gradle/template/init.gradle' line: 17

* What went wrong:
Could not compile script '/home/ferry/vcs/x/cnf/gradle/template/init.gradle'.
> startup failed:
  script '/home/ferry/vcs/x/cnf/gradle/template/init.gradle': 17: unable to resolve class aQute.bnd.osgi.Constants
   @ line 17, column 1.
     import aQute.bnd.osgi.Constants
     ^

  script '/home/ferry/vcs/x/cnf/gradle/template/init.gradle': 16: unable to resolve class aQute.bnd.build.Workspace
   @ line 16, column 1.
     import aQute.bnd.build.Workspace
     ^

  2 errors

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED in 0s
bjhargrave commented 7 years ago

Works fine for me:

[hargrave@macbookpro3 bndtoolsWorkspace (master)]$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    new file:   cnf/gradle/dependencies/biz.aQute.bnd.gradle/biz.aQute.bnd.gradle-3.4.0.jar

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    deleted:    cnf/gradle/dependencies/biz.aQute.bnd.gradle/biz.aQute.bnd.gradle-3.3.0.jar
    modified:   gradle.properties

[hargrave@macbookpro3 bndtoolsWorkspace (master)]$ git diff
diff --git a/cnf/gradle/dependencies/biz.aQute.bnd.gradle/biz.aQute.bnd.gradle-3.3.0.jar b/cnf/gradle/dependencies/biz.aQute.bnd.gradle/biz.aQute.bnd.gradle-3.3.0.jar
deleted file mode 100644
index f0f7362..0000000
Binary files a/cnf/gradle/dependencies/biz.aQute.bnd.gradle/biz.aQute.bnd.gradle-3.3.0.jar and /dev/null differ
diff --git a/gradle.properties b/gradle.properties
index 6fd26c3..ea7b40d 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,5 +1,5 @@
 # bnd_jar can also be a URL.
-bnd_jar=cnf/gradle/dependencies/biz.aQute.bnd.gradle/biz.aQute.bnd.gradle-3.3.0.jar
+bnd_jar=cnf/gradle/dependencies/biz.aQute.bnd.gradle/biz.aQute.bnd.gradle-3.4.0.jar

 # Default gradle tasks to build for the root project (comma-separated)
 root_defaultTask=build
[hargrave@macbookpro3 bndtoolsWorkspace (master)]$ gradle --no-daemon

> Task :buildEnvironment

------------------------------------------------------------
Root project
------------------------------------------------------------

classpath
No dependencies

BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
fhuberts commented 7 years ago

Doesn't work for me.

Try the bnd-340 branch from here: https://github.com/fhuberts/bndtoolsWorkspace/tree/bnd-340

bjhargrave commented 7 years ago
cnf/localrepo/biz.aQute.bnd.annotation/biz.aQute.bnd.annotation-3.4.0.jar
cnf/plugins/biz.aQute.repository/biz.aQute.repository.jar

don't exist in the git repo and git grep does not find those BSNs.

I replaced the repoindex.cli jar:

diff --git a/cnf/gradle/template/index.gradle b/cnf/gradle/template/index.gradle
index 50f46d8..ad67e60 100644
--- a/cnf/gradle/template/index.gradle
+++ b/cnf/gradle/template/index.gradle
@@ -33,7 +33,7 @@ if (!hasProperty('indexR5Compressed'   )) ext.indexR5Compressed    = true

 ext.indexBindexJar     = "${rootDir}/${bnd_cnf}/gradle/gradle/dependencies/org.osgi.impl.bundle.bindex/org.osgi.impl.bundle.bindex-3.0.0.jar"
 ext.indexBindexMain    = 'org.osgi.impl.bundle.bindex.cli.Index'
-ext.indexRepoindexJar  = "${rootDir}/${bnd_cnf}/gradle/dependencies/org.osgi.impl.bundle.repoindex.cli/org.osgi.impl.bundle.repoindex.cli-3.3.0.jar"
+ext.indexRepoindexJar  = "${rootDir}/${bnd_cnf}/gradle/dependencies/org.osgi.impl.bundle.repoindex.cli/org.osgi.impl.bundle.repoindex.cli-3.4.0.jar"
 ext.indexRepoindexMain = 'org.osgi.impl.bundle.bindex.cli.Index'

and it still works fine.

If you still have issue, make a PR on your repo which I can pull down. I don't want to be chasing piecemeal how to reproduce your problem.

bjhargrave commented 7 years ago

Doesn't work for me.

Ttry the bnd-340 branch from here: https://github.com/fhuberts/bndtoolsWorkspace/tree/bnd-340

You failed to edit

diff --git a/cnf/gradle/template/index.gradle b/cnf/gradle/template/index.gradle
index 50f46d8..ad67e60 100644
--- a/cnf/gradle/template/index.gradle
+++ b/cnf/gradle/template/index.gradle
@@ -33,7 +33,7 @@ if (!hasProperty('indexR5Compressed'   )) ext.indexR5Compressed    = true

 ext.indexBindexJar     = "${rootDir}/${bnd_cnf}/gradle/gradle/dependencies/org.osgi.impl.bundle.bindex/org.osgi.impl.bundle.bindex-3.0.0.jar"
 ext.indexBindexMain    = 'org.osgi.impl.bundle.bindex.cli.Index'
-ext.indexRepoindexJar  = "${rootDir}/${bnd_cnf}/gradle/dependencies/org.osgi.impl.bundle.repoindex.cli/org.osgi.impl.bundle.repoindex.cli-3.3.0.jar"
+ext.indexRepoindexJar  = "${rootDir}/${bnd_cnf}/gradle/dependencies/org.osgi.impl.bundle.repoindex.cli/org.osgi.impl.bundle.repoindex.cli-3.4.0.jar"
 ext.indexRepoindexMain = 'org.osgi.impl.bundle.bindex.cli.Index'

diff --git a/gradle.properties b/gradle.properties
index 6fd26c3..ea7b40d 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,5 +1,5 @@
 # bnd_jar can also be a URL.
-bnd_jar=cnf/gradle/dependencies/biz.aQute.bnd.gradle/biz.aQute.bnd.gradle-3.3.0.jar
+bnd_jar=cnf/gradle/dependencies/biz.aQute.bnd.gradle/biz.aQute.bnd.gradle-3.4.0.jar

 # Default gradle tasks to build for the root project (comma-separated)
 root_defaultTask=build

to use the new versions.

bjhargrave commented 7 years ago

Also, 3.4.0 is not fully released yet. It is not yet in maven central.

fhuberts commented 7 years ago

blast, completely overlooked those in the grep I did. Works now, sorry for the noise

fhuberts commented 7 years ago

I grabbed the build from cloudbees