-
Notifications
You must be signed in to change notification settings - Fork 103
Adding gradle support #75
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,8 @@ | ||
| /target | ||
| .idea | ||
| .settings | ||
| .circleci | ||
| mpl.iml | ||
| .factorypath | ||
| .gradle/** | ||
| build/** | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The POSIX text line ends with newline symbol, so any text file should contain the newline in the end. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /* | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably better to put here a better comment like "Secondary way to build mpl with gradle" - the main is still maven. |
||
| * This file was generated by the Gradle 'init' task. | ||
| */ | ||
|
|
||
| apply plugin: 'groovy' | ||
| apply plugin: 'java' | ||
| apply plugin: 'jacoco' | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That should be here? There is no way to not use it in some restricted environment where mavencentral or jcenter is blocked? |
||
| jcenter() | ||
| maven { url 'http://repo.jenkins-ci.org/releases/' } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just public? |
||
| maven { url 'http://repo.jenkins-ci.org/public/' } | ||
| } | ||
|
|
||
| dependencies { | ||
| compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '3.0.3' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The versions should be in sync with maven configs. |
||
| compile group: 'com.cloudbees', name: 'groovy-cps', version: '1.24' | ||
| compile 'org.kohsuke.stapler:stapler:1.257.2@jar' | ||
| compile 'org.jenkins-ci.main:jenkins-core:2.107.3@jar' | ||
| compile 'org.jenkins-ci.plugins.workflow:workflow-api:2.40@jar' | ||
| compile 'org.jenkins-ci.plugins.workflow:workflow-basic-steps:2.20@jar' | ||
| compile 'org.jenkins-ci.plugins.workflow:workflow-cps:2.81@jar' | ||
| compile 'org.jenkins-ci.plugins.workflow:workflow-cps-global-lib:2.16@jar' | ||
| compile 'org.jenkins-ci.plugins.workflow:workflow-step-api:2.22@jar' | ||
| compile group: 'com.lesfurets', name: 'jenkins-pipeline-unit', version: '1.1' | ||
|
|
||
| testCompile group: 'junit', name: 'junit', version: '4.12' | ||
| testCompile group: 'org.mockito', name: 'mockito-core', version: '2.+' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why mockito is here? The deps should be quite the same as in maven build - minimal number of deps. |
||
| } | ||
|
|
||
| sourceSets { | ||
| main { | ||
| groovy { | ||
| // all code files will be in either of the folders | ||
| srcDirs = ['src', 'vars', 'resources'] | ||
| } | ||
| } | ||
| test { | ||
| groovy { | ||
| srcDirs = ['test', 'src', 'resources', 'vars'] | ||
| } | ||
| } | ||
| } | ||
|
|
||
| jacocoTestReport { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like some custom report not actually needed or should be in sync with maven. |
||
| reports { | ||
| xml.enabled false | ||
| csv.enabled false | ||
| html.enabled true | ||
| } | ||
| } | ||
|
|
||
| group = 'com.griddynamics.devops' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe move those params to the top? |
||
| description = 'Modular Pipeline Library' | ||
| sourceCompatibility = '1.8' | ||
|
|
||
| task prepareForTests(type: Copy) { | ||
| from(projectDir) { | ||
| include 'src/**/*.*' | ||
| include 'vars/**/*.*' | ||
| include 'resources/**/*.*' | ||
| include 'build.gradle' | ||
| include 'settings.gradle' | ||
| } | ||
| // TODO: try to come up with a more elegant way of doing this - it's like that to avoid completely breaking maven support | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't like todo's in the changes - it like asking "who want to fix me? Noone? Weird...". Please describe what's the actual thing and let's check the proper ways maybe? |
||
| into "${buildDir}/classes/groovy/test/${project.name}@snapshot" | ||
| } | ||
|
|
||
| test { | ||
| dependsOn prepareForTests | ||
| // using grape causes issues with missing classpaths | ||
| // as gradle does not use ivy by default. | ||
| systemProperty 'groovy.grape.enable', 'false' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm, I thought maven allows to use grapes and they could be used by tests sometimes, maybe to figure out what's wrong with it instead of just disabling? Maybe it's just your env issue? |
||
|
|
||
| // show more info on failing tests | ||
| testLogging { | ||
| exceptionFormat = 'full' | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,11 @@ | |
| * Common build module | ||
| */ | ||
|
|
||
| MPLModule('Maven Build', CFG) | ||
| if ( fileExists('build.gradle')) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You changing the interface here, there should be other way because default build system is maven, but still way to use gradle build for circleci automation (also need to be added as a separated pipeline). |
||
| MPLModule('Gradle Build', CFG) | ||
| } else { | ||
| MPLModule('Maven Build', CFG) | ||
| } | ||
|
|
||
| if( fileExists('openshift') ) { | ||
| MPLModule('Openshift Build', CFG) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the list - here should be just the ignores related to the project, not your environment. Your env settings you can put to global gitignore of your environment.