-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
693 changed files
with
211,795 additions
and
5,035 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
install: | ||
- mvn -s settings.xml deploy -Possrh | ||
- ./gradlew uploadArchives --scan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,277 @@ | ||
|
||
plugins { | ||
id 'com.gradle.build-scan' version '2.1' | ||
} | ||
|
||
description = "Butterfly - Application transformation tool" | ||
|
||
allprojects { | ||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
apply plugin: "jacoco" | ||
|
||
group = 'com.paypal.butterfly' | ||
version = '3.0.0' | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
buildScan { | ||
termsOfServiceUrl = 'https://gradle.com/terms-of-service' | ||
termsOfServiceAgree = 'yes' | ||
} | ||
} | ||
|
||
Set testModules = [ | ||
"integration-tests", | ||
"tests" | ||
] | ||
|
||
subprojects { | ||
|
||
apply plugin: 'java' | ||
|
||
def javaVersion = JavaVersion.VERSION_1_8 | ||
sourceCompatibility = javaVersion | ||
targetCompatibility = javaVersion | ||
|
||
test { | ||
testLogging { | ||
events "failed" | ||
// events "started", "passed", "skipped", "failed", "standardError" | ||
|
||
// outputs.upToDateWhen {false} | ||
// showStandardStreams = true | ||
} | ||
} | ||
|
||
// compileJava { | ||
// options.compilerArgs += ["-Xlint:deprecation", "-Xlint:unchecked"] | ||
// } | ||
|
||
ext { | ||
ossrhUsername = System.getenv('SONATYPE_USER') | ||
ossrhPassword = System.getenv('SONATYPE_PASSWORD') | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes 'Implementation-Version': version, | ||
'Implementation-Name': name, | ||
'Implementation-Vendor': 'PayPal' | ||
} | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
if (version.endsWith("SNAPSHOT")) { | ||
if (!name.equals("butterfly-cli-package")) { | ||
artifacts { | ||
archives sourcesJar | ||
} | ||
} | ||
} else if (System.getenv("SECRING_FILE") != null) { | ||
if (!name.equals("butterfly-cli-package")) { | ||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
artifacts { | ||
archives javadocJar, sourcesJar | ||
} | ||
} | ||
|
||
project.ext['signing.keyId'] = "$System.env.GPG_KEYNAME" | ||
project.ext['signing.password'] = "$System.env.GPG_PASSPHRASE" | ||
project.ext['signing.secretKeyRingFile'] = "$System.env.SECRING_FILE" | ||
|
||
signing { | ||
sign configurations.archives | ||
} | ||
} | ||
|
||
// Publishing non test modules | ||
if (!testModules.contains(name)) { | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
if (!version.endsWith("SNAPSHOT") && System.getenv("SECRING_FILE") != null) { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
} | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
pom.project { | ||
name project.name | ||
description project.description | ||
packaging 'jar' | ||
|
||
url 'https://github.com/paypal/butterfly' | ||
|
||
scm { | ||
connection 'scm:git:[email protected]:paypal/butterfly.git' | ||
developerConnection 'scm:git:[email protected]:paypal/butterfly.git' | ||
url '[email protected]:paypal/butterfly.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'MIT' | ||
url 'https://opensource.org/licenses/MIT' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'fabiocarvalho777' | ||
name 'Fabio Carvalho' | ||
email '[email protected]' | ||
organization 'PayPal' | ||
organizationUrl 'http://www.paypal.com' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
jacocoTestCoverageVerification { | ||
violationRules { | ||
rule { element = 'PACKAGE'; limit { minimum = 0.28 }; includes = ['com.paypal.butterfly.cli'] } | ||
rule { element = 'PACKAGE'; limit { minimum = 0.71 }; includes = ['com.paypal.butterfly.cli.logging'] } | ||
rule { element = 'PACKAGE'; limit { minimum = 0.41 }; includes = ['com.paypal.butterfly.core*'] } | ||
rule { element = 'PACKAGE'; limit { minimum = 0.54 }; includes = ['com.paypal.butterfly.extensions.api'] } | ||
rule { element = 'PACKAGE'; limit { minimum = 0.00 }; includes = ['com.paypal.butterfly.extensions.api*'] } | ||
rule { element = 'PACKAGE'; limit { minimum = 1.00 }; includes = ['com.paypal.butterfly.extensions.springboot*'] } | ||
rule { element = 'PACKAGE'; limit { minimum = 0.00 }; includes = ['com.paypal.butterfly.persist*'] } | ||
rule { element = 'PACKAGE'; limit { minimum = 0.63 }; includes = ['com.paypal.butterfly.test*'] } | ||
rule { element = 'PACKAGE'; limit { minimum = 0.82 }; includes = ['com.paypal.butterfly.utilities*'] } | ||
} | ||
} | ||
|
||
} | ||
|
||
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) { | ||
def coverageProjects = subprojects.stream().filter({sb -> !(sb.name in [ | ||
// Projects without Java code | ||
'butterfly-bom', | ||
'butterfly-cli-package', | ||
'extensions-catalog', | ||
|
||
// API projects without concrete classes, or relevant classes, to be tested | ||
'butterfly-api', | ||
'butterfly-rest-api', | ||
|
||
// Test projects | ||
'tests', | ||
'integration-tests' | ||
])}).collect() | ||
|
||
additionalSourceDirs = files(coverageProjects.sourceSets.main.allSource.srcDirs) | ||
sourceDirectories = files(coverageProjects.sourceSets.main.allSource.srcDirs) | ||
classDirectories = files(coverageProjects.sourceSets.main.output) | ||
executionData = files(coverageProjects.jacocoTestReport.executionData) | ||
reports { | ||
html.enabled = true | ||
xml.enabled = true | ||
csv.enabled = false | ||
|
||
html.destination file("${buildDir}/reports/jacoco/html") | ||
xml.destination file("${buildDir}/reports/jacoco/coverage.xml") | ||
} | ||
} | ||
|
||
// Returns the hash number of the latest commit | ||
ext.getGitHash = { -> | ||
def stdout = new ByteArrayOutputStream() | ||
exec { | ||
commandLine 'git', 'log', '-1', '--pretty=%H' | ||
standardOutput = stdout | ||
} | ||
return stdout.toString().trim() | ||
} | ||
|
||
// Returns a String made of project version and commit hash number as a suffix, | ||
// used to tag SNAPSHOT Docker images | ||
ext.getCommitProjectVersion = { version -> | ||
if (version.endsWith('SNAPSHOT')) { | ||
return version + "-" + getGitHash() | ||
} else { | ||
return version | ||
} | ||
} | ||
|
||
// Docker repository | ||
// Leaving it empty intentionally, so it defaults to Docker public DTR | ||
ext.docker_repo = '' | ||
|
||
// Dependencies version management | ||
ext.lib = [ | ||
|
||
// Java specs | ||
annotation_api: "javax.annotation:javax.annotation-api:1.3.2", | ||
jaxrs: "javax.ws.rs:javax.ws.rs-api:2.1", | ||
bean_validation: "javax.validation:validation-api:2.0.1.Final", | ||
|
||
// Spring | ||
spring_context: "org.springframework:spring-context:4.3.2.RELEASE", | ||
spring_boot_starter: "org.springframework.boot:spring-boot-starter:1.4.0.RELEASE", | ||
spring_boot_autoconfigure: "org.springframework.boot:spring-boot-autoconfigure:1.4.0.RELEASE", | ||
spring_test: "org.springframework:spring-test:4.3.2.RELEASE", | ||
|
||
// Maven | ||
maven_model: "org.apache.maven:maven-model:3.5.4", | ||
maven_invoker: "org.apache.maven.shared:maven-invoker:3.0.1", | ||
|
||
// Parsers | ||
gson: "com.google.code.gson:gson:2.7", | ||
woodstox_core: "com.fasterxml.woodstox:woodstox-core:5.0.3", | ||
xmlunit: "xmlunit:xmlunit:1.5", | ||
yamlbeans: "com.esotericsoftware.yamlbeans:yamlbeans:1.08", | ||
javaparser_core: "com.github.javaparser:javaparser-core:3.15.14", | ||
jackson: "com.fasterxml.jackson.core:jackson-annotations:2.9.8", | ||
jackson_databind: "com.fasterxml.jackson.core:jackson-databind:2.9.8", | ||
|
||
// Drivers | ||
lightcouch: "org.lightcouch:lightcouch:0.1.8", | ||
|
||
// Utilities | ||
annotations: "com.google.code.findbugs:annotations:3.0.0", | ||
commons_io: "commons-io:commons-io:2.5", | ||
commons_lang3: "org.apache.commons:commons-lang3:3.7", | ||
commons_collections4: "org.apache.commons:commons-collections4:4.0", | ||
guava: "com.google.guava:guava:15.0", | ||
jopt_simple: "net.sf.jopt-simple:jopt-simple:5.0.2", | ||
plexus_utils: "org.codehaus.plexus:plexus-utils:3.1.0", | ||
reflections: "org.reflections:reflections:0.9.10", | ||
slf4j_api: "org.slf4j:slf4j-api:1.7.21", | ||
logback: "ch.qos.logback:logback-classic:1.1.7", | ||
zip4j: "net.lingala.zip4j:zip4j:1.3.2", | ||
|
||
// Swagger | ||
swagger_annotations: "io.swagger.core.v3:swagger-annotations:2.0.8", | ||
|
||
// Tests | ||
testng: "org.testng:testng:6.14.2", | ||
mockito_all: "org.mockito:mockito-all:1.10.19", | ||
powermock_module_testng: "org.powermock:powermock-module-testng:1.6.5", | ||
powermock_api_mockito: "org.powermock:powermock-api-mockito:1.6.5", | ||
|
||
// Jersey | ||
jersey_core: "org.glassfish.jersey.core:jersey-client:2.26", | ||
jersey_inject: "org.glassfish.jersey.inject:jersey-hk2:2.26", | ||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apply plugin: 'java-library' | ||
|
||
dependencies { | ||
api project(':butterfly-extensions-api') | ||
} |
Oops, something went wrong.