-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update project structure to support multiple published subprojects
- Add tiny-remapper-provider - Update LICENSE year - Update README to the new docs root URL - Create conventions included build to separate logic - Use (configuration) cache - Restructure mappings-util -> lib, with proper root project - Use typesafe project accessors
- Loading branch information
1 parent
aa63d42
commit 240fb1a
Showing
938 changed files
with
82,448 additions
and
11,352 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,144 +1,26 @@ | ||
import org.jetbrains.dokka.gradle.DokkaTask | ||
import java.net.URI | ||
allprojects { | ||
group = "com.grappenmaker" | ||
version = "0.1.8" | ||
} | ||
|
||
plugins { | ||
alias(libs.plugins.kotlin.jvm) | ||
alias(libs.plugins.kotlin.jvm) apply false | ||
alias(libs.plugins.dokka) | ||
`maven-publish` | ||
`java-library` | ||
signing | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
group = "com.grappenmaker" | ||
version = "0.1.7" | ||
|
||
kotlin { | ||
jvmToolchain(8) | ||
explicitApi() | ||
compilerOptions { freeCompilerArgs.add("-Xcontext-receivers") } | ||
} | ||
|
||
val dokkaJavadoc by tasks.getting(DokkaTask::class) | ||
val dokkaAsJavadoc by tasks.registering(Jar::class) { | ||
dependsOn(dokkaJavadoc) | ||
from(dokkaJavadoc.outputDirectory) | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
} | ||
|
||
dependencies { | ||
api(libs.bundles.asm) | ||
api(libs.coroutines.core) | ||
testImplementation(kotlin("test")) | ||
} | ||
|
||
publishing { | ||
publications { | ||
fun MavenPublication.setup() { | ||
artifact(dokkaAsJavadoc) | ||
from(components["java"]) | ||
pom { | ||
name = project.name | ||
description = "A library for handling and using JVM name mappings (SRG, Tiny, Proguard)" | ||
url = "https://github.com/770grappenmaker/mappings-util" | ||
packaging = "jar" | ||
|
||
licenses { | ||
license { | ||
name = "The MIT License" | ||
url = "https://opensource.org/license/mit/" | ||
distribution = "repo" | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = "770grappenmaker" | ||
name = "NotEvenJoking" | ||
email = "770grappenmaker@gmail.com" | ||
url = "https://github.com/770grappenmaker/" | ||
} | ||
} | ||
|
||
scm { | ||
connection = "scm:git:git://github.com/770grappenmaker/mappings-util.git" | ||
developerConnection = "scm:git:ssh://github.com:770grappenmaker/mappings-util.git" | ||
url = "https://github.com/770grappenmaker/mappings-util/tree/main" | ||
} | ||
} | ||
} | ||
|
||
create<MavenPublication>("central") { | ||
groupId = "io.github.770grappenmaker" | ||
setup() | ||
} | ||
|
||
create<MavenPublication>("packages", MavenPublication::setup) | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "Packages" | ||
url = uri("https://maven.pkg.github.com/770grappenmaker/mappings-util") | ||
|
||
credentials { | ||
username = System.getenv("GITHUB_ACTOR") | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
|
||
maven { | ||
name = "Central" | ||
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
credentials(PasswordCredentials::class) | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign(publishing.publications) | ||
} | ||
|
||
tasks { | ||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events("passed") | ||
} | ||
} | ||
|
||
withType<DokkaTask>().configureEach { | ||
dokkaSourceSets.configureEach { | ||
val test by project(":samples").sourceSets.getting | ||
samples.from(test.kotlin) | ||
reportUndocumented = true | ||
|
||
sourceLink { | ||
localDirectory = rootDir | ||
remoteUrl = URI("https://github.com/770grappenmaker/mappings-util/tree/main").toURL() | ||
remoteLineSuffix = "#L" | ||
} | ||
|
||
includes.from("dokka-module.md") | ||
val docsDir = projectDir.resolve("docs") | ||
val deployDocs by registering(Copy::class) { | ||
notCompatibleWithConfigurationCache("indirectly invokes dokka which makes it unsupported") | ||
|
||
externalDocumentationLink { | ||
url = URI("https://asm.ow2.io/javadoc/").toURL() | ||
packageListUrl = project.layout.projectDirectory.file("asm.package-list").asFile.toURI().toURL() | ||
} | ||
} | ||
} | ||
dependsOn(dokkaHtmlMultiModule) | ||
from(dokkaHtmlMultiModule.map { it.outputDirectory }) | ||
into(docsDir) | ||
|
||
val dokkaHtml by getting | ||
val deployDocs by registering(Copy::class) { | ||
dependsOn(dokkaHtml) | ||
from(dokkaHtml) | ||
into(projectDir.resolve("docs")) | ||
duplicatesStrategy = DuplicatesStrategy.FAIL | ||
} | ||
} |
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,12 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.dokka) | ||
implementation(libs.kotlin.jvm) | ||
} |
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 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
|
||
rootProject.name = "conventions" | ||
|
||
plugins { | ||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" | ||
} |
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,12 @@ | ||
plugins { | ||
id("org.jetbrains.kotlin.jvm") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(8) | ||
compilerOptions { freeCompilerArgs.add("-Xcontext-receivers") } | ||
} |
126 changes: 126 additions & 0 deletions
126
conventions/src/main/kotlin/published-library.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,126 @@ | ||
import org.jetbrains.dokka.gradle.DokkaTask | ||
import org.jetbrains.dokka.gradle.DokkaTaskPartial | ||
import java.net.URI | ||
|
||
plugins { | ||
`maven-publish` | ||
`java-library` | ||
signing | ||
id("kotlin-convention") | ||
id("org.jetbrains.dokka") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
val dokkaJavadoc by tasks.getting(DokkaTask::class) | ||
val dokkaAsJavadoc by tasks.registering(Jar::class) { | ||
dependsOn(dokkaJavadoc) | ||
from(dokkaJavadoc.outputDirectory) | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
java { withSourcesJar() } | ||
kotlin { explicitApi() } | ||
|
||
interface PublishingConventionExtension { | ||
val enablePackages: Property<Boolean> | ||
} | ||
|
||
val libraryExtension = project.extensions.create<PublishingConventionExtension>("publishedLibrary").apply { | ||
enablePackages.convention(false) | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
fun MavenPublication.setup() { | ||
artifact(dokkaAsJavadoc) | ||
from(components["java"]) | ||
|
||
pom { | ||
name = project.name | ||
description = "A library for handling and using JVM name mappings (SRG, Tiny, Proguard)" | ||
url = "https://github.com/770grappenmaker/mappings-util" | ||
packaging = "jar" | ||
|
||
licenses { | ||
license { | ||
name = "The MIT License" | ||
url = "https://opensource.org/license/mit/" | ||
distribution = "repo" | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id = "770grappenmaker" | ||
name = "NotEvenJoking" | ||
email = "770grappenmaker@gmail.com" | ||
url = "https://github.com/770grappenmaker/" | ||
} | ||
} | ||
|
||
scm { | ||
connection = "scm:git:git://github.com/770grappenmaker/mappings-util.git" | ||
developerConnection = "scm:git:ssh://github.com:770grappenmaker/mappings-util.git" | ||
url = "https://github.com/770grappenmaker/mappings-util/tree/main" | ||
} | ||
} | ||
} | ||
|
||
create<MavenPublication>("central") { | ||
groupId = "io.github.770grappenmaker" | ||
setup() | ||
} | ||
|
||
if (libraryExtension.enablePackages.get()) create<MavenPublication>("packages", MavenPublication::setup) | ||
} | ||
|
||
repositories { | ||
if (libraryExtension.enablePackages.get()) maven { | ||
name = "Packages" | ||
url = uri("https://maven.pkg.github.com/770grappenmaker/mappings-util") | ||
|
||
credentials { | ||
username = System.getenv("GITHUB_ACTOR") | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
|
||
maven { | ||
name = "Central" | ||
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
credentials(PasswordCredentials::class) | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign(publishing.publications) | ||
} | ||
|
||
tasks { | ||
withType<DokkaTaskPartial>().configureEach { | ||
dokkaSourceSets.configureEach { | ||
val test by project(":samples").sourceSets.getting | ||
samples.from(test.extensions.getByName("kotlin")) | ||
reportUndocumented = true | ||
|
||
sourceLink { | ||
localDirectory = rootDir | ||
remoteUrl = URI("https://github.com/770grappenmaker/mappings-util/tree/main").toURL() | ||
remoteLineSuffix = "#L" | ||
} | ||
|
||
includes.from("dokka-module.md") | ||
|
||
externalDocumentationLink { | ||
url = URI("https://asm.ow2.io/javadoc/").toURL() | ||
packageListUrl = rootProject.layout.projectDirectory.file("asm.package-list").asFile.toURI().toURL() | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.