-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradle 4.0-rc1 warning #94
Comments
I have a fix for this, but I'm waiting for another fix in the shadow plugin
to be able to push it.
Le 31 mai 2017 3:19 AM, "Ben Manes" <[email protected]> a écrit :
… Using a single directory for all classes from a source set. This behaviour
has been deprecated and is scheduled to be removed in Gradle 5.0
at jmh_5wogb9c5ft7s9r37j0u9kbr28.run(/Users/ben/projects/
caffeine/gradle/jmh.gradle:5)
That points to the apply statement for this plugin.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#94>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATTxen9P80ssjRn8-dubrc1uagUFQBvks5r_MAagaJpZM4NrCpS>
.
|
Note that this version would only be compatible with Gradle 4.0+ and Shadow plugin 2.0+. It makes use of the new worker API, which avoids us doing all the nasty jar repackaging of the runtime of JMH: a worker process is automatically spawned by Gradle with the appropriate classpath. This means that we can compile this plugin with a specific version of JMH, but the user can override the version, and we would still use the `Main` entry point instead of an exec task to execute the benchmarks. This commit also fixes the [warning issued by Gradle 4.0](#94), which is the main reason for broken compatibility with released under 4.0: the newer API doesn't exist on 3.5. This commit however breaks a test with the shadow plugin, and is waiting for the resolution of [this bug](GradleUp/shadow#297).
Fixed by #96 |
Seems to fail with an NPE when using Gradle 4, jmh 1.19, plugin 0.4.1, and shadow 2.0.1.
|
And if I clean first, it fails with a manifest error. FAILURE: Build failed with an exception.
* What went wrong:
Could not copy MANIFEST.MF to '/Users/ben/projects/caffeine/caffeine/build/tmp/jmhJar/MANIFEST.MF'.
> A Jar can only accept a valid file or directory: /Users/ben/projects/caffeine/caffeine/build/osgi-classes
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.GradleException: Could not copy MANIFEST.MF to '/Users/ben/projects/caffeine/caffeine/build/tmp/jmhJar/MANIFEST.MF'.
at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:79)
at org.gradle.api.internal.file.collections.MapFileTree$FileVisitDetailsImpl.getFile(MapFileTree.java:172)
at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter$FileVisitorImpl.visitFile(DefaultFileSystemSnapshotter.java:223)
at org.gradle.api.internal.file.collections.MapFileTree$Visit.visit(MapFileTree.java:135)
at org.gradle.api.internal.file.collections.MapFileTree.visit(MapFileTree.java:88)
at org.gradle.api.internal.file.collections.MapFileTree.visitTreeOrBackingFile(MapFileTree.java:252)
at org.gradle.api.internal.file.collections.FileTreeAdapter.visitTreeOrBackingFile(FileTreeAdapter.java:125)
at org.gradle.api.internal.file.AbstractFileTree$FilteredFileTreeImpl.visitTreeOrBackingFile(AbstractFileTree.java:196)
at org.gradle.api.internal.changedetection.state.DefaultFileSystemSnapshotter.snapshotTree(DefaultFileSystemSnapshotter.java:158)
at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter$FileCollectionVisitorImpl.visitTree(AbstractFileCollectionSnapshotter.java:90)
at org.gradle.api.internal.file.AbstractFileTree.visitRootElements(AbstractFileTree.java:149)
at org.gradle.api.internal.file.CompositeFileCollection.visitRootElements(CompositeFileCollection.java:185)
at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter.snapshot(AbstractFileCollectionSnapshotter.java:51)
at org.gradle.api.internal.changedetection.state.DefaultGenericFileCollectionSnapshotter.snapshot(DefaultGenericFileCollectionSnapshotter.java:36)
at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.buildSnapshots(AbstractNamedFileSnapshotTaskStateChanges.java:91)
at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.<init>(AbstractNamedFileSnapshotTaskStateChanges.java:58)
at org.gradle.api.internal.changedetection.rules.InputFilesTaskStateChanges.<init>(InputFilesTaskStateChanges.java:29)
at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:60)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:178)
at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:88)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:242)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:235)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:224)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:121)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:77)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:102)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:96)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:612)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:567)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:96)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: A Jar can only accept a valid file or directory: /Users/ben/projects/caffeine/caffeine/build/osgi-classes
at aQute.bnd.osgi.Jar.<init>(Jar.java:81)
at aQute.bnd.osgi.Jar.<init>(Jar.java:99)
at aQute.bnd.osgi.Analyzer.setJar(Analyzer.java:1369)
at org.gradle.api.internal.plugins.osgi.DefaultOsgiManifest.setAnalyzerProperties(DefaultOsgiManifest.java:125)
at org.gradle.api.internal.plugins.osgi.DefaultOsgiManifest.getEffectiveManifest(DefaultOsgiManifest.java:69)
at org.gradle.api.internal.plugins.osgi.DefaultOsgiManifest_Decorated.getEffectiveManifest(Unknown Source)
at org.gradle.api.java.archives.internal.DefaultManifestMergeSpec.createManifest(DefaultManifestMergeSpec.java:142)
at org.gradle.api.java.archives.internal.DefaultManifestMergeSpec.merge(DefaultManifestMergeSpec.java:83)
at org.gradle.api.java.archives.internal.DefaultManifestMergeSpec$merge.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at com.github.jengelman.gradle.plugins.shadow.tasks.DefaultInheritManifest$_getEffectiveManifest_closure1.doCall(DefaultInheritManifest.groovy:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2040)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2025)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2066)
at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.github.jengelman.gradle.plugins.shadow.tasks.DefaultInheritManifest.getEffectiveManifest(DefaultInheritManifest.groovy:62)
at com.github.jengelman.gradle.plugins.shadow.tasks.DefaultInheritManifest.getEffectiveManifest(DefaultInheritManifest.groovy)
at org.gradle.api.java.archives.internal.CustomManifestInternalWrapper.getEffectiveManifest(CustomManifestInternalWrapper.java:73)
at org.gradle.api.java.archives.internal.DefaultManifest.writeTo(DefaultManifest.java:197)
at org.gradle.api.java.archives.internal.CustomManifestInternalWrapper.writeTo(CustomManifestInternalWrapper.java:47)
at org.gradle.jvm.tasks.Jar$1$1.execute(Jar.java:76)
at org.gradle.jvm.tasks.Jar$1$1.execute(Jar.java:63)
at org.gradle.api.internal.file.collections.MapFileTree$FileVisitDetailsImpl.copyTo(MapFileTree.java:184)
at org.gradle.api.internal.file.AbstractFileTreeElement.copyFile(AbstractFileTreeElement.java:93)
at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:74)
... 48 more |
@ben-manes do you have a self contained build reproducing the problem I could look at? |
I checked in the changes into this repository. Not sure if I can easily simplify to a smaller example if its interactions with other details, but is overall a small build. |
Thanks, let me look into it. I can't promise anything as I'm travelling, but I will let you know! |
Thanks! |
This commit fixes a potential NPE, as reported in #94
@ben-manes It seems there are 2 different things going on there.
You can try the fix by checking out the sources of this plugin, then run on your
(it will automatically build the JMH plugin for you and allow you to test it without publishing) |
Great, that works nicely. I'll add the |
Thanks again! |
That points to the apply statement for this plugin.
The text was updated successfully, but these errors were encountered: