-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Migrate publication to precompiled build script
Also add gradle-nexus.publish-plugin
- Loading branch information
Showing
16 changed files
with
129 additions
and
163 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,15 +1,27 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
subprojects { | ||
version = getLibVersion() | ||
group = "com.redmadrobot.debug" | ||
plugins { | ||
id("io.github.gradle-nexus.publish-plugin") version "2.0.0" | ||
} | ||
|
||
subprojects { | ||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach { | ||
kotlinOptions.freeCompilerArgs += listOf( | ||
"-opt-in=com.redmadrobot.debug_panel_core.annotation.DebugPanelInternal" | ||
) | ||
} | ||
} | ||
|
||
nexusPublishing { | ||
// Uncomment if you need to release artifacts uploaded using "publish" task. | ||
// repositoryDescription.set("Implicitly created (auto staging).") | ||
repositories { | ||
sonatype { | ||
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) | ||
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) | ||
} | ||
} | ||
} | ||
|
||
tasks.register("clean", Delete::class) { | ||
delete(rootProject.layout.buildDirectory) | ||
} |
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,95 @@ | ||
import internal.android | ||
import java.util.Properties | ||
|
||
plugins { | ||
id("maven-publish") | ||
id("signing") | ||
} | ||
|
||
android { | ||
publishing { | ||
singleVariant("release") { | ||
withSourcesJar() | ||
} | ||
} | ||
} | ||
|
||
private val publishProperties by lazy { | ||
rootProject.file("gradle/publish.properties").inputStream() | ||
.use { Properties().apply { load(it) } } | ||
} | ||
val libraryName by lazy { | ||
val properties = project.file("library.properties").inputStream() | ||
.use { Properties().apply { load(it) } } | ||
properties.getProperty("lib_name") | ||
} | ||
|
||
publishing { | ||
publications.create<MavenPublication>("release") { | ||
artifactId = libraryName | ||
|
||
afterEvaluate { from(components["release"]) } | ||
|
||
pom { | ||
name = libraryName | ||
description = provider { project.description } | ||
url = publishProperties.getProperty("home_page") | ||
|
||
licenses { | ||
license { | ||
name = publishProperties.getProperty("license_name") | ||
url = publishProperties.getProperty("license_url") | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = "Zestxx" | ||
name = "Roman Choriev" | ||
email = "[email protected]" | ||
} | ||
} | ||
|
||
contributors { | ||
contributor { | ||
name = "Osip Fatkullin" | ||
email = "[email protected]" | ||
} | ||
contributor { | ||
name = "Alexandr Anisimov" | ||
email = "[email protected]" | ||
} | ||
contributor { | ||
name = "Dmitry trabo" | ||
email = "[email protected]" | ||
} | ||
} | ||
|
||
scm { | ||
connection = "scm:git:git://github.com/RedMadRobot/debug-panel-android.git" | ||
developerConnection = "scm:git:ssh://github.com/RedMadRobot/debug-panel-android.git" | ||
url = publishProperties.getProperty("home_page") | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
maven { | ||
name = "OSSRH" | ||
url = project.uri(publishProperties.getProperty("sonatype_repo")) | ||
|
||
credentials { | ||
username = System.getenv("OSSRH_USER") | ||
password = System.getenv("OSSRH_PASSWORD") | ||
} | ||
} | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
signing { | ||
useGpgCmd() | ||
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,8 @@ | ||
package internal | ||
|
||
import com.android.build.api.dsl.LibraryExtension | ||
import org.gradle.api.plugins.ExtensionAware | ||
|
||
internal fun ExtensionAware.android(configure: LibraryExtension.() -> Unit) { | ||
extensions.configure<LibraryExtension>("android", configure) | ||
} |
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
home_page=https://github.com/RedMadRobot/debug-panel-android | ||
group_id=com.redmadrobot.debug | ||
|
||
sonatype_repo=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2 | ||
|
||
license_name=MIT License | ||
license_url=http://opensource.org/licenses/MIT | ||
|
||
lib_version=0.7.5 |
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