-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
1 parent
cc91d15
commit 8009a55
Showing
5 changed files
with
141 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
// --- Prepare Settings --- | ||
static def isReleaseBuild() { | ||
return System.getenv('IS_RELEASE') == "true" ?: false | ||
} | ||
def getRepositoryUsername() { | ||
return findProperty('OSSRH_USERNAME') ?: System.getenv('OSSRH_USERNAME') ?: "" | ||
} | ||
def getRepositoryPassword() { | ||
return findProperty('OSSRH_PASSWORD') ?: System.getenv('OSSRH_PASSWORD') ?: "" | ||
} | ||
def getSigningKeyId() { | ||
return findProperty('SIGNING_KEY_ID') ?: System.getenv('SIGNING_KEY_ID') ?: "" | ||
} | ||
def getSigningKey() { | ||
return findProperty('SIGNING_KEY') ?: System.getenv('SIGNING_KEY') ?: "" | ||
} | ||
def getSigningPassword() { | ||
return findProperty('SIGNING_PASSWORD') ?: System.getenv('SIGNING_PASSWORD') ?: "" | ||
} | ||
|
||
//if (!project.tasks.findByName('sourcesJar')) { | ||
// task sourcesJar(type: Jar) { | ||
// archiveClassifier.set('sources') | ||
// if (pluginManager.hasPlugin('com.android.library')) { | ||
// from android.sourceSets.main.java.srcDirs | ||
// } else { | ||
// from sourceSets.main.allSource.srcDirs | ||
// } | ||
// } | ||
//} | ||
// | ||
//artifacts { | ||
// archives dokkaJar | ||
// archives sourcesJar | ||
//} | ||
|
||
// --- Publish --- | ||
|
||
// OSS Sonatype Repo | ||
// s01.oss.sonatype.com | ||
def OSSRepo = "s01.oss.sonatype.org" | ||
//def OSSRepo = "oss.sonatype.org" | ||
|
||
afterEvaluate { | ||
publishing { | ||
repositories { | ||
maven { | ||
name "snapshot" | ||
url = "https://$OSSRepo/content/repositories/snapshots" | ||
credentials { | ||
username = getRepositoryUsername() | ||
password = getRepositoryPassword() | ||
} | ||
} | ||
maven { | ||
name "staging" | ||
url = "https://$OSSRepo/service/local/staging/deploy/maven2" | ||
credentials { | ||
username = getRepositoryUsername() | ||
password = getRepositoryPassword() | ||
} | ||
} | ||
} | ||
|
||
// if (!pluginManager.hasPlugin('org.jetbrains.kotlin.multiplatform')) { | ||
publications { | ||
release(MavenPublication) { | ||
from components.javaPlatform | ||
// artifact sourcesJar | ||
artifactId = project.name | ||
} | ||
} | ||
// } | ||
|
||
publications.all { | ||
// artifact dokkaJar | ||
|
||
pom.withXml { | ||
def root = asNode() | ||
|
||
root.children().last() + { | ||
resolveStrategy = Closure.DELEGATE_FIRST | ||
|
||
description "KOIN - Kotlin simple Dependency Injection Framework" | ||
name project.name | ||
url "https://insert-koin.io/" | ||
licenses { | ||
license { | ||
name "The Apache Software License, Version 2.0" | ||
url "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
} | ||
} | ||
scm { | ||
url "https://github.com/InsertKoinIO/koin" | ||
connection "scm:git:git://github.com/InsertKoinIO/koin.git" | ||
developerConnection "scm:git:git://github.com/InsertKoinIO/koin.git" | ||
} | ||
developers { | ||
developer { | ||
id "arnaudgiuliani" | ||
name "Arnaud Giuliani" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (isReleaseBuild()) { | ||
signing { | ||
useInMemoryPgpKeys( | ||
getSigningKeyId(), | ||
getSigningKey(), | ||
getSigningPassword(), | ||
) | ||
|
||
if (pluginManager.hasPlugin('org.jetbrains.kotlin.multiplatform')) { | ||
publishing.publications.all { | ||
sign it | ||
} | ||
} else { | ||
sign publishing.publications.release | ||
} | ||
} | ||
} | ||
} |
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,4 @@ | ||
#!/bin/sh | ||
|
||
../gradlew publishToMavenLocal | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
../gradlew publishAllPublicationsToStagingRepository --max-workers 1 | ||
|
||
|