Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Criterion Benchmark Library #35

Merged
merged 19 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restructure Gradle build
* Add `maven-publish` plugin
* Publish sources jar
* Set artifact group
* Allow publication overrides
  • Loading branch information
msteindorfer committed Oct 2, 2023
commit 74512428b0a17b72837e202f8bf5b1656b3d3aaa
34 changes: 28 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
plugins {
`java-library`
`maven-publish`
}

val majorMinorPatchVersion = "0.7.2"
val isSnapshotBuild = !project.hasProperty("isReleaseBuild")
version = version.let { conformVersionToMavenConvention("${it}") }

version = majorMinorPatchVersion.let {
if (isSnapshotBuild) "${it}-SNAPSHOT" else "${it}"
}
fun conformVersionToMavenConvention(it: String): String =
if (project.hasProperty("releaseBuild")) "${it}" else "${it}-SNAPSHOT"

val junitVersion by extra { "5.8.2" }
val junitQuickcheckVersion by extra { "1.0" }
Expand All @@ -21,6 +20,8 @@ dependencies {
}

java {
withSourcesJar()

toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
Expand All @@ -32,7 +33,7 @@ tasks.compileJava {

tasks.jar {
manifest {
attributes["Automatic-Module-Name"] = "io.usethesource.capsule"
attributes["Automatic-Module-Name"] = "${rootProject.group}.${rootProject.name}"
}
}

Expand All @@ -52,3 +53,24 @@ tasks.test {
}
}
}

publishing {
publications {
create<MavenPublication>("maven") {
groupId = System.getenv("CAPSULE_MAVEN_PUBLICATION_GROUP_ID") ?: groupId
artifactId = System.getenv("CAPSULE_MAVEN_PUBLICATION_ARTIFACT_ID") ?: artifactId
version = System.getenv("CAPSULE_MAVEN_PUBLICATION_VERSION")?.let { conformVersionToMavenConvention("${it}") } ?: version

pom {
licenses {
license {
name.set("BSD 2-Clause Simplified License")
url.set("https://raw.githubusercontent.com/usethesource/capsule/main/LICENSE")
}
}
}

from(components["java"])
}
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
group=io.usethesource
version=0.7.2
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "capsule"