Skip to content
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

Worker API follow up #35

Closed
wants to merge 2 commits into from

Conversation

larsgrefer
Copy link
Contributor

This PR is a continuation of #32

@aaschmid
Copy link
Owner

aaschmid commented Apr 7, 2019

Problem was that properties of Cpd*FileReportImpl - which are used by Gradle - are not serializeable in the end. Therefore I build a mapping to simple DTOs for them.

Now a java.util.ServiceConfigurationError appears in most unit tests :-(
Even though integration test work, packaging the plugin and use it another projects fails it...

java.util.ServiceConfigurationError: net.sourceforge.pmd.cpd.Language: Provider net.sourceforge.pmd.cpd.CPPLanguage not a subtype
	at java.util.ServiceLoader.fail(ServiceLoader.java:239)
	at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
	at net.sourceforge.pmd.cpd.LanguageFactory.<init>(LanguageFactory.java:27)
	at net.sourceforge.pmd.cpd.LanguageFactory.<clinit>(LanguageFactory.java:16)
	at de.aaschmid.gradle.plugins.cpd.internal.CpdAction.run(CpdAction.java:78)
	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:39)
	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:25)
	at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory$WorkerCallable.call(IsolatedClassloaderWorkerFactory.java:177)
	at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory.executeInWorkerClassLoader(IsolatedClassloaderWorkerFactory.java:105)
	at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory.access$100(IsolatedClassloaderWorkerFactory.java:54)
	at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory$1$1.call(IsolatedClassloaderWorkerFactory.java:78)
	at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory$1$1.call(IsolatedClassloaderWorkerFactory.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.workers.internal.IsolatedClassloaderWorkerFactory$1.execute(IsolatedClassloaderWorkerFactory.java:75)
	at org.gradle.workers.internal.DefaultWorkerExecutor$1.call(DefaultWorkerExecutor.java:102)
	at org.gradle.workers.internal.DefaultWorkerExecutor$1.call(DefaultWorkerExecutor.java:96)
	at org.gradle.internal.work.AbstractConditionalExecution$1.run(AbstractConditionalExecution.java:38)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:212)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:161)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:130)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:748)

@aaschmid
Copy link
Owner

aaschmid commented Apr 7, 2019

to be honest ... don't know if we currently have the proper way-of-work for this issue. What's your opinion to follow up?

I would like to create a new version with your other changes and maybe we should rebase all our changes on that? What do you think @larsgrefer?

Edit: Testing on other projects can be done easily by using something like

buildscript {
    dependencies {
        classpath files('../gradle-cpd-plugin/build/libs/gradle-cpd-plugin-1.2.jar')
    }
}
// ...
apply plugin: 'cpd'

@larsgrefer
Copy link
Contributor Author

I'm not sure why you've already merged #32 since it was clearly marked as draft. I also wasn't finished with looking at all the comments you've made. In addition to that, I have not had time yet to fully test my changes.

@aaschmid
Copy link
Owner

aaschmid commented Apr 9, 2019

First, I merged it, because I have had time on the weekend to work on it and it was looking quite promising to include it in the next version with the other changes. Second, to be honest, I wasn't sure if you were angry about all my comments and the delay ...

Sorry for the hasty things and the missunderstanding. Suggestion: So if you want, you can rebase your branch ('feature/workerApi') upon master, work on my comments from #32, and I will remove the 'use-worker' branch from this repo such that you have time to fix it all.

I will meanwhile create a new release with all the other changes if you don't mind?

Sounds like a plan or do you @larsgrefer have a different idea?

@aaschmid aaschmid closed this Apr 22, 2019
@aaschmid
Copy link
Owner

aaschmid commented Apr 22, 2019

Hi @larsgrefer, I took your squashed commits (you are still the "author") and refactored my code and test test cases to get the "Gradle Worker API" running, see https://github.com/aaschmid/gradle-cpd-plugin/tree/use-worker-api. I very much hope that you are not pissed or angry by our missunderstanding :-( I am very sorry for that.

Thank you very much for your efforts!

@aaschmid aaschmid added this to the v1.4 milestone Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants