-
Notifications
You must be signed in to change notification settings - Fork 45
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
1 changed file
with
38 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
plugins { | ||
id 'java-library' | ||
id 'java' | ||
id 'checkstyle' | ||
id "com.github.spotbugs" version "3.0.0" | ||
id 'maven-publish' | ||
id 'signing' | ||
id 'com.bmuschko.nexus' version '2.3.1' // prepares and copies artifacts to Sonotype OSS | ||
id "io.codearte.nexus-staging" version "0.21.2" // logs into Sonotype OSS and does a "Close" and "Release" | ||
id 'com.adarshr.test-logger' version '2.0.0' | ||
id "com.github.ben-manes.versions" version "0.27.0" | ||
|
@@ -21,28 +20,22 @@ tasks.withType(JavaCompile) { | |
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
api 'com.thoughtworks.xstream:xstream:1.4.11.1' | ||
compile 'com.thoughtworks.xstream:xstream:1.4.11.1' | ||
|
||
testImplementation 'junit:junit:4.13' | ||
testCompile 'junit:junit:4.13' | ||
} | ||
|
||
jar { | ||
// specify the archive name; otherwise the version is appended to the war file | ||
archiveFileName = 'x12-parser.jar' | ||
|
||
manifest { | ||
attributes('Implementation-Title': project.name, | ||
'Implementation-Version': archiveVersion, | ||
'Implementation-Version': version, | ||
'Implementation-Vendor': group, | ||
'Created-By': System.properties['java.vm.version'] + ' (' + System.properties['java.vm.vendor'] + ')', | ||
'Built-By': System.getProperty('user.name'), | ||
|
@@ -66,92 +59,52 @@ spotbugs { | |
excludeFilter = file('config/spotbugs/spotbugs-exclude.xml') | ||
} | ||
|
||
wrapper { | ||
gradleVersion = '6.1' | ||
distributionType = Wrapper.DistributionType.ALL | ||
} | ||
|
||
// don't try to release a snapshot to a non-snapshot repository, that won't work anyway | ||
if (version.endsWith('-SNAPSHOT')) { | ||
gradle.startParameter.excludedTaskNames += 'signMavenJavaPublication' | ||
if (version.endsWith('-SNAPSHOT')) | ||
gradle.startParameter.excludedTaskNames += 'closeAndReleaseRepository' | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId = 'x12-parser' | ||
from components.java | ||
versionMapping { | ||
usage('java-api') { | ||
fromResolutionOf('runtimeClasspath') | ||
} | ||
usage('java-runtime') { | ||
fromResolutionResult() | ||
} | ||
} | ||
pom { | ||
name = 'X12 Parser' | ||
description = 'A Java library for parsing X12 files, including ANSI 837' | ||
url = 'https://github.com/imsweb/x12-parser' | ||
inceptionYear = '2015' | ||
|
||
licenses { | ||
license { | ||
name = 'A modified BSD License (BSD)' | ||
url = 'https://github.com/imsweb/x12-parser/blob/master/LICENSE' | ||
distribution = 'repo' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = 'AngelaszekD' | ||
name = 'David Angelaszek' | ||
email = '[email protected]' | ||
} | ||
developer { | ||
id = 'ctmay4' | ||
name = 'Chuck May' | ||
email = '[email protected]' | ||
} | ||
|
||
} | ||
|
||
scm { | ||
url = 'https://github.com/imsweb/x12-parser' | ||
connection = 'scm:https://github.com/imsweb/x12-parser.git' | ||
developerConnection = 'scm:[email protected]:imsweb/x12-parser.git' | ||
} | ||
modifyPom { | ||
project { | ||
name 'X12 Parser' | ||
description 'A Java library for parsing X12 files, including ANSI 837' | ||
url 'https://github.com/imsweb/x12-parser' | ||
inceptionYear '2015' | ||
|
||
scm { | ||
url 'https://github.com/imsweb/x12-parser' | ||
connection 'scm:https://github.com/imsweb/x12-parser.git' | ||
developerConnection 'scm:[email protected]:imsweb/x12-parser.git' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'A modified BSD License (BSD)' | ||
url 'https://github.com/imsweb/x12-parser/blob/master/LICENSE' | ||
distribution 'repo' | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" | ||
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
|
||
credentials { | ||
username = project.hasProperty('nexusUsername') ? project.getProperty('nexusUsername') : '' | ||
password = project.hasProperty('nexusPassword') ? project.getProperty('nexusPassword') : '' | ||
|
||
developers { | ||
developer { | ||
id 'AngelaszekD' | ||
name 'David Angelaszek' | ||
email '[email protected]' | ||
} | ||
developer { | ||
id 'ctmay4' | ||
name 'Chuck May' | ||
email '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications.mavenJava | ||
} | ||
|
||
nexusStaging { | ||
numberOfRetries = 50 | ||
delayBetweenRetriesInMillis = 5000 | ||
} | ||
|
||
javadoc { | ||
if (JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
wrapper { | ||
gradleVersion = '6.1' | ||
distributionType = Wrapper.DistributionType.ALL | ||
} | ||
|