Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
/target
.idea
Copy link
Collaborator

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.

.settings
.circleci
mpl.iml
.factorypath
.gradle/**
build/**
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

80 changes: 80 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
Copy link
Collaborator

Choose a reason for hiding this comment

The 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()
Copy link
Collaborator

Choose a reason for hiding this comment

The 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/' }
Copy link
Collaborator

Choose a reason for hiding this comment

The 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'
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.+'
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The 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'
Copy link
Collaborator

Choose a reason for hiding this comment

The 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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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'
Copy link
Collaborator

Choose a reason for hiding this comment

The 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'
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
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
183 changes: 183 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 103 additions & 0 deletions gradlew.bat

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
Expand Up @@ -2,7 +2,11 @@
* Common build module
*/

MPLModule('Maven Build', CFG)
if ( fileExists('build.gradle')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The 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)
Expand Down
Loading