ASSERT-KTH/depclean

Porting Maven tests to Gradle tests

bbaudry opened this issue · 6 comments

This folder includes small Maven projects to be used for testing Depclean with Maven:
https://github.com/castor-software/depclean/tree/master/depclean-maven-plugin/src/test/resources-its/

@ABHAY0O7, can you add build.gradle files for each of these projects, so you can use them to test the Depclean gradle plugin?

Hi! @bbaudry,
I think you are saying that I have to convert these maven projects into Gradle projects so that I can use them in testing of Gradle plugin?
If Yes, then this single command gradle init will do the whole work for me.
If this approach is not correct, then enlighten me with some correct ways of doing this.

Thank you

I think you are saying that I have to convert these maven projects into Gradle projects so that I can use them in testing of Gradle plugin?

You are right @ABHAY0O7, that's exactly the goal

Hello @bbaudry @tdurieux
I need some help!
As in the Maven plugin, we copy all the dependencies locally by invoking the maven command
mvn dependency:copy-dependencies -DoutputDirectory=$buildDir\dependencies. See here
But in a Gradle project to copy dependencies locally, I am unable to find the exact command which can be directly used from the terminal. All I am getting is this configurations that I have to add manually in my buld.gradle file.

task copyToLib(type: Copy) {
    into "$buildDir/output/lib"
    from configurations.runtime
}

But I need the corresponding command that I can directly invoke from the terminal.
Can you please tell me the exact command for this?

Thank you
Abhay

There is probably no command for that. You will need to code it. You can do that by taking the classpath and copying all the dependency in the good folder

Yes, I can code it in my build.gradle and use the task through the command line but, when the users will use the plugin then I have to explicitly tell them to add this

task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.runtime
}

section in their build.gradle file along with the plugin configurations.
Will that be okay?
Or is there any other way so that I can directly write to their build.gradle file and can use this task in the backlog directly through my code?