Is there anyway I can create a two module projects in gradle, and trigger a build for each module by itself?
Root project 'Example'
Jenkinsfile
\--- Project ':SubProject'
Jenkinsfile
I want that jenkins will trigger a build only in the module that has been changed.
for example :
If my SubProject
changed, then only SubProject
will execute it's own Jenkinsfile
.
I looked up for this option for a very long time...
As you can see in the other questions, there is no any easy way to achieve that.
Is there any Jenkins pipeline
or plugin
that can deal with that?
The subproject producer defines a task named buildInfo that generates a properties file containing build information e.g. the project version. You can then map the task provider to its output file and Gradle will automatically establish a task dependency.
Create a Jenkins job Enter a new name for the project. We'll pick "gradle-site-plugin" for the project. Select the radio button "Git" in the section "Source Code Management". Enter the URL of the GitHub repository: https://github.com/gradle/gradle-site-plugin.git .
It is the official build tool for Android. Gradle provides integration with several development tools and servers, including Eclipse, IntelliJ, Jenkins, and Android Studio.
./gradlew :build
./gradlew :SubProject:build
However, the triggering of one project only will most likely be the tricky thing as they most likely live in the same source control location.
Maybe the easy fix is also to have them decoupled, using svn:externals
or Git submodules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With