-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
15 changed files
with
123 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
### Check | ||
|
||
You can run all the local checks with the `./gradlew check` task. | ||
|
||
- Detekt | ||
- Ktlint | ||
- Unit tests | ||
|
||
### Publishing | ||
|
||
To be able to publish on Maven Central, you need to create a `local.properties` file | ||
at the root of the project with the following properties: | ||
|
||
``` | ||
# Maven OSSRH credentials | ||
ossrhUsername= | ||
ossrhPassword= | ||
# GPG Signing key info | ||
signing.keyId=… | ||
signing.secretKeyRingFile=… | ||
signing.password=… | ||
``` |
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
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 |
---|---|---|
|
@@ -4,17 +4,60 @@ import org.gradle.api.Project | |
import org.gradle.api.publish.PublishingExtension | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import org.gradle.kotlin.dsl.get | ||
import org.gradle.plugins.signing.SigningExtension | ||
|
||
fun Project.mavenConfig() { | ||
extensionConfig<PublishingExtension> { | ||
const val GROUP_NAME = "fr.xgouchet.elmyr" | ||
const val VERSION = "1.4.0" | ||
|
||
fun Project.mavenConfig(projectDescription: String) { | ||
|
||
group = GROUP_NAME | ||
version = VERSION | ||
|
||
val publishingExtension = extensionConfig<PublishingExtension> { | ||
publications.create("maven", MavenPublication::class.java) { | ||
groupId = "com.github.xgouchet" | ||
groupId = GROUP_NAME | ||
artifactId = project.name | ||
version = "1.4.0" | ||
version = VERSION | ||
|
||
from(components["kotlin"]) | ||
artifact(tasks.findByName("kotlinSourcesJar")) | ||
artifact(tasks.findByName("generateJavadoc")) | ||
|
||
pom { | ||
name.set(project.name) | ||
description.set(projectDescription) | ||
url.set("https://github.com/xgouchet/Elmyr/") | ||
|
||
licenses { | ||
license { | ||
name.set("MIT") | ||
url.set("https://opensource.org/license/mit/") | ||
} | ||
} | ||
developers { | ||
developer { | ||
name.set("Xavier F. Gouchet") | ||
email.set("[email protected]") | ||
roles.set(listOf("Author", "Maintainer")) | ||
} | ||
} | ||
|
||
scm { | ||
url.set("https://github.com/xgouchet/Elmyr/") | ||
connection.set("scm:git:[email protected]:xgouchet/Elmyr.git") | ||
developerConnection.set("scm:git:[email protected]:xgouchet/Elmyr.git") | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (publishingExtension != null) { | ||
extensionConfig<SigningExtension> { | ||
// val privateKey =project.properties["ossrhUsername"]?.toString() | ||
// val password = System.getenv("GPG_PASSWORD") | ||
// useInMemoryPgpKeys(privateKey, password) | ||
sign(publishingExtension.publications.getByName("maven")) | ||
} | ||
} | ||
} |
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
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