-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from ajoberstar/central
Publish to maven central
- Loading branch information
Showing
30 changed files
with
495 additions
and
425 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 was deleted.
Oops, something went wrong.
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,9 @@ | ||
plugins { | ||
id("org.ajoberstar.grgit") | ||
id("org.ajoberstar.reckon") | ||
} | ||
|
||
reckon { | ||
scopeFromProp() | ||
stageFromProp("alpha", "beta", "rc", "final") | ||
} |
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,11 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.0.0") | ||
} |
91 changes: 91 additions & 0 deletions
91
buildSrc/src/main/kotlin/java-library-convention.gradle.kts
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,91 @@ | ||
plugins { | ||
`java-library` | ||
`maven-publish` | ||
`signing` | ||
id("locking-convention") | ||
id("spotless-convention") | ||
} | ||
|
||
group = "org.ajoberstar.grgit" | ||
description = "The Groovy way to use Git." | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "CentralReleases" | ||
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
credentials { | ||
username = System.getenv("OSSRH_USERNAME") | ||
password = System.getenv("OSSRH_PASSWORD") | ||
} | ||
} | ||
|
||
maven { | ||
name = "CentralSnapshots" | ||
url = uri("https://oss.sonatype.org/content/repositories/snapshots/") | ||
credentials { | ||
username = System.getenv("OSSRH_USERNAME") | ||
password = System.getenv("OSSRH_PASSWORD") | ||
} | ||
} | ||
} | ||
|
||
publications { | ||
create<MavenPublication>("main") { | ||
from(components["java"]) | ||
|
||
versionMapping { | ||
usage("java-api") { | ||
fromResolutionOf("runtimeClasspath") | ||
} | ||
usage("java-runtime") { | ||
fromResolutionResult() | ||
} | ||
} | ||
|
||
pom { | ||
name.set("Reckon") | ||
description.set("Infer a project's version from your Git repository.") | ||
url.set("https://github.com/ajoberstar/reckon") | ||
|
||
developers { | ||
developer { | ||
name.set("Andrew Oberstar") | ||
email.set("[email protected]") | ||
} | ||
} | ||
|
||
licenses { | ||
license { | ||
name.set("The Apache Software License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0") | ||
} | ||
} | ||
|
||
scm { | ||
url.set("https://github.com/ajoberstar/reckon") | ||
connection.set("scm:git:[email protected]:ajoberstar/reckon.git") | ||
developerConnection.set("scm:git:ssh:[email protected]:ajoberstar/reckon.git") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
setRequired(System.getenv("CI")) | ||
val signingKey: String? by project | ||
val signingPassphrase: String? by project | ||
useInMemoryPgpKeys(signingKey, signingPassphrase) | ||
sign(publishing.publications["main"]) | ||
} |
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,28 @@ | ||
plugins { | ||
`java-base` | ||
} | ||
|
||
java { | ||
sourceSets.configureEach { | ||
val confNames = listOf(compileClasspathConfigurationName, runtimeClasspathConfigurationName) | ||
confNames.forEach { confName -> | ||
val conf = configurations.named(confName) | ||
conf.resolutionStrategy.activateDependencyLocking() | ||
} | ||
} | ||
} | ||
|
||
tasks.register("lock") { | ||
doFirst { | ||
require(gradle.startParameter.isWriteDependencyLocks) | ||
} | ||
doLast { | ||
sourceSets.configureEach { | ||
val confNames = listOf(compileClasspathConfigurationName, runtimeClasspathConfigurationName) | ||
confNames.forEach { confName -> | ||
val conf = configurations.named(confName) | ||
conf.resolve() | ||
} | ||
} | ||
} | ||
} |
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,27 @@ | ||
plugins { | ||
id("com.diffplug.spotless") | ||
} | ||
|
||
spotless { | ||
plugins.withId("java") { | ||
java { | ||
importOrder("java", "javax", "") | ||
removeUnusedImports() | ||
eclipse().configFile(project.rootProject.file("gradle/eclipse-java-formatter.xml")) | ||
} | ||
} | ||
plugins.withId("groovy") { | ||
format("groovy") { | ||
target("src/**/*.groovy") | ||
trimTrailingWhitespace() | ||
indentWithSpaces(2) | ||
endWithNewline() | ||
} | ||
} | ||
format("gradle") { | ||
target("**/*.gradle") | ||
trimTrailingWhitespace() | ||
indentWithSpaces(2) | ||
endWithNewline() | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.