-
Notifications
You must be signed in to change notification settings - Fork 16
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' of https://github.com/icpc/live-v3
- Loading branch information
Showing
50 changed files
with
2,946 additions
and
551 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,116 +1,8 @@ | ||
import com.github.jengelman.gradle.plugins.shadow.ShadowJavaPlugin | ||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
// versions are set in dependencies block for build.gradle.kts | ||
// apply false brings the plugins into the Gradle script classpath (see import above) | ||
alias(libs.plugins.kotlin.jvm) apply false | ||
alias(libs.plugins.shadow) apply false | ||
} | ||
|
||
tasks { | ||
register<Task>("doc") { | ||
dependsOn(project(":cds").tasks.named("dokkaHtmlMultiModule")) | ||
} | ||
|
||
// If you invoke a gen task, :schema-generator:gen will be invoked. It's defined in :schema-generator project | ||
// since that project is already aware of global location for schema testing purposes. | ||
} | ||
|
||
subprojects { | ||
group = "org.icpclive" | ||
version = rootProject.findProperty("build_version")!! | ||
|
||
|
||
plugins.withType<MavenPublishPlugin> { | ||
afterEvaluate { | ||
configure<PublishingExtension> { | ||
repositories { | ||
maven { | ||
name = "GitHubPackages" | ||
url = uri("https://maven.pkg.github.com/icpc/live-v3") | ||
credentials { | ||
username = System.getenv("GITHUB_ACTOR") | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
} | ||
publications { | ||
create<MavenPublication>("mavenJava${this@subprojects.name}") { | ||
pom { | ||
name = "ICPC live contest data system parser" | ||
description = "Parser for a various programming competition contest systems" | ||
url = "https://github.com/icpc/live-v3" | ||
licenses { | ||
license { | ||
name = "The MIT License" | ||
url = "http://opensource.org/licenses/MIT" | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:git://github.com/icpc/live-v3.git") | ||
developerConnection.set("scm:git:ssh://github.com/icpc/live-v3.git") | ||
url.set("https://github.com/icpc/live-v3") | ||
} | ||
} | ||
versionMapping { | ||
usage("java-api") { | ||
fromResolutionOf("runtimeClasspath") | ||
} | ||
usage("java-runtime") { | ||
fromResolutionResult() | ||
} | ||
} | ||
from(components["java"]) | ||
groupId = "org.icpclive" | ||
version = rootProject.findProperty("build_version")!!.toString() | ||
artifactId = "org.icpclive.cds.${this@subprojects.name}" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
plugins.withType<JavaPlugin> { | ||
configure<JavaPluginExtension> { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
tasks.named<Jar>("jar") { | ||
archiveClassifier = "just" | ||
} | ||
|
||
tasks.named<Test>("test") { | ||
useJUnitPlatform() | ||
} | ||
register<Task>("gen") { | ||
dependsOn(project("schema-generator").tasks.named("gen")) | ||
} | ||
|
||
// Technically, Ktor pulls this too, but reconfigures... | ||
plugins.withType<ShadowJavaPlugin> { | ||
tasks.register<Sync>("release") { | ||
destinationDir = rootDir.resolve("artifacts/") | ||
preserve { include("*") } | ||
from(tasks.named("shadowJar")) | ||
} | ||
tasks.named<ShadowJar>("shadowJar") { | ||
mergeServiceFiles() | ||
|
||
archiveClassifier = null | ||
} | ||
} | ||
|
||
tasks { | ||
withType<KotlinCompile>().configureEach { | ||
kotlinOptions { | ||
compilerOptions { | ||
freeCompilerArgs.add("-Xjvm-default=all") | ||
optIn = listOf("kotlinx.serialization.ExperimentalSerializationApi") | ||
} | ||
allWarningsAsErrors = true | ||
} | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
|
||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
dependencies { | ||
implementation(libs.gradleplugin.kotlin.jvm) | ||
implementation(libs.gradleplugin.kotlin.serialization) | ||
implementation(libs.gradleplugin.shadow) | ||
implementation(libs.gradleplugin.dokka) | ||
implementation(libs.gradleplugin.bcv) | ||
implementation(libs.gradleplugin.ksp) | ||
} |
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 @@ | ||
dependencyResolutionManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
|
||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") | ||
rootProject.name = "convention-plugins" | ||
|
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,23 @@ | ||
import org.gradle.api.tasks.Sync | ||
import org.gradle.kotlin.dsl.application | ||
import org.gradle.kotlin.dsl.register | ||
|
||
plugins { | ||
application | ||
id("live.kotlin-conventions") | ||
id("com.github.johnrengelman.shadow") | ||
} | ||
|
||
tasks { | ||
register<Sync>("release") { | ||
destinationDir = rootDir.resolve("artifacts/") | ||
preserve { include("*") } | ||
from(tasks.named("shadowJar")) | ||
} | ||
|
||
shadowJar { | ||
mergeServiceFiles() | ||
|
||
archiveClassifier = null | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
buildSrc/src/main/kotlin/live.cds-plugin-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,16 @@ | ||
import org.gradle.api.artifacts.VersionCatalogsExtension | ||
|
||
val catalogs = extensions.getByType<VersionCatalogsExtension>() | ||
|
||
|
||
plugins { | ||
id("live.library-conventions") | ||
id("live.ksp-conventions") | ||
} | ||
|
||
dependencies { | ||
api(project(":cds:core")) | ||
implementation(catalogs.named("libs").findLibrary("kotlinx-datetime").get()) | ||
implementation(catalogs.named("libs").findLibrary("kotlinx-serialization-json").get()) | ||
testImplementation(project(":cds:tests")) | ||
} |
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,2 @@ | ||
group = "org.icpclive" | ||
version = rootProject.findProperty("build_version")!! |
36 changes: 36 additions & 0 deletions
36
buildSrc/src/main/kotlin/live.kotlin-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,36 @@ | ||
plugins { | ||
java | ||
kotlin("jvm") | ||
id("live.common-conventions") | ||
id("org.jetbrains.kotlin.plugin.serialization") | ||
} | ||
|
||
val catalogs = extensions.getByType<VersionCatalogsExtension>() | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
} | ||
|
||
tasks.named<Jar>("jar") { | ||
archiveClassifier = "just" | ||
} | ||
|
||
tasks.named<Test>("test") { | ||
useJUnitPlatform() | ||
} | ||
|
||
kotlin { | ||
compilerOptions { | ||
allWarningsAsErrors = true | ||
compilerOptions { | ||
freeCompilerArgs.add("-Xjvm-default=all") | ||
optIn = listOf("kotlinx.serialization.ExperimentalSerializationApi") | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
testImplementation(catalogs.named("libs").findLibrary("kotlin-junit").get()) | ||
} |
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 @@ | ||
plugins { | ||
id("live.kotlin-conventions") | ||
id("com.google.devtools.ksp") | ||
} | ||
|
||
dependencies { | ||
compileOnly(project(":ksp")) | ||
ksp(project(":ksp")) | ||
} |
77 changes: 77 additions & 0 deletions
77
buildSrc/src/main/kotlin/live.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,77 @@ | ||
import org.jetbrains.dokka.gradle.DokkaTaskPartial | ||
import java.net.* | ||
|
||
plugins { | ||
id("live.kotlin-conventions") | ||
id("org.jetbrains.dokka") | ||
id("org.jetbrains.kotlinx.binary-compatibility-validator") | ||
`java-library` | ||
`maven-publish` | ||
} | ||
|
||
kotlin { | ||
explicitApi() | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "GitHubPackages" | ||
url = uri("https://maven.pkg.github.com/icpc/live-v3") | ||
credentials { | ||
username = System.getenv("GITHUB_ACTOR") | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
} | ||
publications { | ||
val libName = name | ||
create<MavenPublication>("mavenJava${libName}") { | ||
pom { | ||
name = "ICPC live contest data system parser" | ||
description = "Parser for a various programming competition contest systems" | ||
url = "https://github.com/icpc/live-v3" | ||
licenses { | ||
license { | ||
name = "The MIT License" | ||
url = "http://opensource.org/licenses/MIT" | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:git://github.com/icpc/live-v3.git") | ||
developerConnection.set("scm:git:ssh://github.com/icpc/live-v3.git") | ||
url.set("https://github.com/icpc/live-v3") | ||
} | ||
} | ||
versionMapping { | ||
usage("java-api") { | ||
fromResolutionOf("runtimeClasspath") | ||
} | ||
usage("java-runtime") { | ||
fromResolutionResult() | ||
} | ||
} | ||
from(components["java"]) | ||
groupId = "org.icpclive" | ||
version = rootProject.findProperty("build_version")!!.toString() | ||
artifactId = "org.icpclive.cds.${libName}" | ||
} | ||
} | ||
} | ||
|
||
tasks { | ||
withType<DokkaTaskPartial>().configureEach { | ||
dokkaSourceSets.configureEach { | ||
perPackageOption { | ||
matchingRegex.set(".*") | ||
reportUndocumented.set(true) | ||
sourceLink { | ||
val projectDir = "https://github.com/icpc/live-v3/tree/main/" | ||
localDirectory.set(rootProject.projectDir) | ||
remoteUrl.set(URI(projectDir).toURL()) | ||
remoteLineSuffix.set("#L") | ||
} | ||
} | ||
} | ||
} | ||
} |
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,13 +1,10 @@ | ||
plugins { | ||
`java-library` | ||
alias(libs.plugins.kotlin.jvm) | ||
alias(libs.plugins.kotlin.serialization) | ||
id("live.kotlin-conventions") | ||
} | ||
|
||
dependencies { | ||
api(libs.kotlinx.serialization.json) | ||
api(libs.kotlinx.datetime) | ||
api(projects.cds.utils) | ||
api(projects.cds.core) | ||
testImplementation(libs.kotlin.junit) | ||
} |
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
Oops, something went wrong.