-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Maven Central publishing and refactor Gradle configurations (#452)
- Loading branch information
1 parent
361d2d4
commit 7564f19
Showing
63 changed files
with
270 additions
and
948 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 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,21 @@ | ||
/* | ||
* Copyright 2024 Readium Foundation. All rights reserved. | ||
* Use of this source code is governed by the BSD-style license | ||
* available in the top-level LICENSE file of the project. | ||
*/ | ||
|
||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.plugin.android) | ||
implementation(libs.plugin.kotlin) | ||
implementation(libs.plugin.maven.publish) | ||
} |
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,13 @@ | ||
/* | ||
* Copyright 2024 Readium Foundation. All rights reserved. | ||
* Use of this source code is governed by the BSD-style license | ||
* available in the top-level LICENSE file of the project. | ||
*/ | ||
|
||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
107 changes: 107 additions & 0 deletions
107
buildSrc/src/main/kotlin/readium.library-conventions.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,107 @@ | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
|
||
plugins { | ||
// FIXME: For now, we cannot use the versions catalog in precompiled scripts: https://github.com/gradle/gradle/issues/15383 | ||
id("com.android.library") | ||
id("com.vanniktech.maven.publish") | ||
id("org.jetbrains.kotlin.android") | ||
kotlin("plugin.parcelize") | ||
} | ||
|
||
group = property("pom.groupId") as String | ||
|
||
android { | ||
resourcePrefix = "readium_" | ||
|
||
compileSdk = (property("android.compileSdk") as String).toInt() | ||
|
||
defaultConfig { | ||
minSdk = (property("android.minSdk") as String).toInt() | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_1_8.toString() | ||
allWarningsAsErrors = true | ||
freeCompilerArgs = freeCompilerArgs + listOf( | ||
"-opt-in=kotlin.RequiresOptIn", | ||
"-opt-in=org.readium.r2.shared.InternalReadiumApi" | ||
) | ||
} | ||
|
||
testOptions { | ||
unitTests.isIncludeAndroidResources = true | ||
} | ||
|
||
buildFeatures { | ||
// FIXME: Look into whether we can remove this. | ||
buildConfig = true | ||
} | ||
|
||
buildTypes { | ||
getByName("release") { | ||
isMinifyEnabled = false | ||
proguardFiles(getDefaultProguardFile("proguard-android.txt")) | ||
} | ||
} | ||
} | ||
|
||
kotlin { | ||
explicitApi() | ||
} | ||
|
||
mavenPublishing { | ||
coordinates( | ||
groupId = group.toString(), | ||
artifactId = property("pom.artifactId") as String, | ||
version = property("pom.version") as String | ||
) | ||
|
||
pom { | ||
name.set(property("pom.artifactId") as String) | ||
description.set("A toolkit for ebooks, audiobooks and comics written in Kotlin") | ||
url.set("https://github.com/readium/kotlin-toolkit") | ||
licenses { | ||
license { | ||
name.set("BSD-3-Clause license") | ||
url.set("https://github.com/readium/kotlin-toolkit/blob/main/LICENSE") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("aferditamuriqi") | ||
name.set("Aferdita Muriqi") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("mickael-menu") | ||
name.set("Mickaël Menu") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("qnga") | ||
name.set("Quentin Gliosca") | ||
email.set("[email protected]") | ||
} | ||
|
||
developer { | ||
id.set("username") | ||
name.set("User Name") | ||
url.set("https://github.com/username/") | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/readium/kotlin-toolkit") | ||
connection.set("scm:git:github.com/readium/kotlin-toolkit.git") | ||
developerConnection.set("scm:git:ssh://github.com/readium/kotlin-toolkit.git") | ||
} | ||
} | ||
|
||
publishToMavenCentral(SonatypeHost.S01) | ||
signAllPublications() | ||
} |
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,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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 @@ | ||
pom.artifactId=readium-adapter-exoplayer-audio |
Oops, something went wrong.