-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ANDROAPP-6097-Create-AssistChip-component
- Loading branch information
Showing
7 changed files
with
87 additions
and
68 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,9 @@ | ||
set -x | ||
|
||
branch=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
if [ "$branch" = "main" ]; then | ||
./gradlew :designsystem:publishToSonatype closeAndReleaseSonatypeStagingRepository -PremoveSnapshotSuffix | ||
else | ||
./gradlew :designsystem:publishToSonatype | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
object Props { | ||
const val DESCRIPTION = "Compose Multiplatform DHIS2 Mobile UI components library" | ||
|
||
const val REPOSITORY_SYSTEM = "GitHub" | ||
const val REPOSITORY_URL = "https://github.com/dhis2/dhis2-mobile-ui" | ||
|
||
const val AUTHOR_NAME = "Mobile team" | ||
const val AUTHOR_EMAIL = "[email protected]" | ||
|
||
const val ORGANIZATION_NAME = "UiO" | ||
const val ORGANIZATION_URL = "http://www.dhis2.org" | ||
|
||
const val LICENSE_NAME = "BSD-3-Clause" | ||
const val LICENSE_URL = "https://opensource.org/license/bsd-3-clause/" | ||
} |
99 changes: 35 additions & 64 deletions
99
convention-plugins/src/main/kotlin/convention.publication.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 |
---|---|---|
@@ -1,101 +1,72 @@ | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import org.gradle.api.tasks.bundling.Jar | ||
import org.gradle.kotlin.dsl.`maven-publish` | ||
import org.gradle.kotlin.dsl.signing | ||
import java.util.* | ||
|
||
plugins { | ||
`maven-publish` | ||
signing | ||
} | ||
|
||
// Stub secrets to let the project sync and build without the publication values set up | ||
ext["signing.keyId"] = null | ||
ext["signing.password"] = null | ||
ext["signing.secretKeyRingFile"] = null | ||
ext["ossrhUsername"] = null | ||
ext["ossrhPassword"] = null | ||
val ossrhUsername: String? = System.getenv("OSSRH_USERNAME") | ||
val ossrhPassword: String? = System.getenv("OSSRH_PASSWORD") | ||
val signingPrivateKey: String? = System.getenv("SIGNING_PRIVATE_KEY") | ||
val signingPassword: String? = System.getenv("SIGNING_PASSWORD") | ||
|
||
// Grabbing secrets from local.properties file or from environment variables, which could be used on CI | ||
val secretPropsFile = project.rootProject.file("local.properties") | ||
if (secretPropsFile.exists()) { | ||
secretPropsFile.reader().use { | ||
Properties().apply { | ||
load(it) | ||
} | ||
}.onEach { (name, value) -> | ||
ext[name.toString()] = value | ||
} | ||
} else { | ||
ext["signing.keyId"] = System.getenv("SIGNING_KEY_ID") | ||
ext["signing.password"] = System.getenv("SIGNING_PASSWORD") | ||
ext["signing.secretKeyRingFile"] = System.getenv("SIGNING_SECRET_KEY_RING_FILE") | ||
ext["ossrhUsername"] = System.getenv("OSSRH_USERNAME") | ||
ext["ossrhPassword"] = System.getenv("OSSRH_PASSWORD") | ||
} | ||
val dokkaHtml = tasks.findByName("dokkaHtml")!! | ||
|
||
val javadocJar by tasks.registering(Jar::class) { | ||
val dokkaHtmlJar = tasks.register<Jar>("dokkaHtmlJar") { | ||
dependsOn(dokkaHtml) | ||
from(dokkaHtml.outputs) | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
fun getExtraString(name: String) = ext[name]?.toString() | ||
|
||
publishing { | ||
// Configure maven central repository | ||
repositories { | ||
maven { | ||
name = "sonatype" | ||
setUrl("https://oss.sonatype.org/content/repositories/snapshots/") | ||
credentials { | ||
username = getExtraString("ossrhUsername") | ||
password = getExtraString("ossrhPassword") | ||
} | ||
} | ||
} | ||
|
||
// Configure all publications | ||
publications.withType<MavenPublication> { | ||
// Stub javadoc.jar artifact | ||
artifact(javadocJar.get()) | ||
artifact(dokkaHtmlJar) | ||
|
||
// Provide artifacts information requited by Maven Central | ||
pom { | ||
name.set("DHIS2 Mobile Design system") | ||
description.set("Compose Multiplatform DHIS2 Mobile UI components library") | ||
url.set("https://github.com/dhis2/dhis2-mobile-ui") | ||
description.set(Props.DESCRIPTION) | ||
url.set(Props.REPOSITORY_URL) | ||
|
||
licenses { | ||
license { | ||
name.set("MIT") | ||
url.set("https://opensource.org/licenses/MIT") | ||
name.set(Props.LICENSE_NAME) | ||
url.set(Props.LICENSE_URL) | ||
} | ||
} | ||
organization { | ||
name.set(Props.ORGANIZATION_NAME) | ||
url.set(Props.ORGANIZATION_URL) | ||
} | ||
developers { | ||
developer { | ||
id.set("andresmr") | ||
name.set("Andres") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("xavimolloy") | ||
name.set("Xavi") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("DavidAparicioAlbaAsenjo") | ||
name.set("David") | ||
email.set("[email protected]") | ||
name.set(Props.AUTHOR_NAME) | ||
email.set(Props.AUTHOR_EMAIL) | ||
organization.set(Props.ORGANIZATION_NAME) | ||
organizationUrl.set(Props.ORGANIZATION_URL) | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/dhis2/dhis2-mobile-ui") | ||
} | ||
issueManagement { | ||
system.set(Props.REPOSITORY_SYSTEM) | ||
url.set(Props.REPOSITORY_URL) | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Signing artifacts. Signing.* extra properties values will be used | ||
signing { | ||
isRequired = false | ||
setRequired({ !version.toString().endsWith("-SNAPSHOT") }) | ||
useInMemoryPgpKeys(signingPrivateKey, signingPassword) | ||
sign(publishing.publications) | ||
} | ||
} | ||
|
||
// Fix Gradle warning about signing tasks using publishing task outputs without explicit dependencies | ||
// https://github.com/gradle/gradle/issues/26091 | ||
tasks.withType<AbstractPublishToMaven>().configureEach { | ||
val signingTasks = tasks.withType<Sign>() | ||
mustRunAfter(signingTasks) | ||
} |
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