Open-source multiplayer game server compatible with the RuneScape client https://www.openrs2.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openrs2/build.gradle.kts

191 lines
5.5 KiB

import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
defaultTasks("build")
plugins {
base
id("com.github.ben-manes.versions") version Versions.versionsPlugin
id("com.github.jk1.dependency-license-report") version Versions.dependencyLicenseReport apply false
id("com.github.johnrengelman.shadow") version Versions.shadowPlugin apply false
id("org.jmailen.kotlinter") version Versions.kotlinter apply false
kotlin("jvm") version Versions.kotlin apply false
}
allprojects {
group = "dev.openrs2"
version = "1.0.0-SNAPSHOT"
repositories {
mavenCentral()
maven(url = "https://repo.openrs2.dev/repository/openrs2")
mavenLocal()
maven(url = "https://repo.openrs2.dev/repository/openrs2-snapshots")
}
plugins.withType<BasePlugin> {
configure<BasePluginConvention> {
archivesBaseName = "${rootProject.name}-$name"
}
}
plugins.withType<ApplicationPlugin> {
tasks.named<JavaExec>("run") {
workingDir = rootProject.projectDir
}
}
plugins.withType<JavaPlugin> {
configure<JavaPluginExtension> {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjsr305=strict")
}
}
tasks.withType<AbstractArchiveTask> {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
tasks.withType<Test> {
reports {
html.isEnabled = false
junitXml.isEnabled = true
}
}
tasks.withType<JacocoReport> {
dependsOn("test")
reports {
csv.isEnabled = false
html.isEnabled = false
xml.isEnabled = false
}
tasks.named("check") {
dependsOn("jacocoTestReport")
}
}
}
val Project.free: Boolean
get() = name != "nonfree" && parent?.name != "nonfree"
configure(subprojects.filter { it.free }) {
apply(plugin = "jacoco")
plugins.withType<KotlinPluginWrapper> {
apply(plugin = "org.jmailen.kotlinter")
dependencies {
val api by configurations
api(kotlin("stdlib-jdk8"))
val implementation by configurations
implementation("com.michael-bull.kotlin-inline-logger:kotlin-inline-logger:${Versions.inlineLogger}")
val testImplementation by configurations
testImplementation(kotlin("test-junit5"))
}
}
plugins.withType<JavaPlugin> {
dependencies {
val testRuntimeOnly by configurations
testRuntimeOnly("org.junit.jupiter:junit-jupiter:${Versions.junit}")
}
}
plugins.withType<ApplicationPlugin> {
dependencies {
val runtimeOnly by configurations
runtimeOnly("ch.qos.logback:logback-classic:${Versions.logback}")
}
}
tasks.withType<Test> {
useJUnitPlatform()
jvmArgs = listOf("-ea", "-Dio.netty.leakDetection.level=PARANOID")
}
plugins.withType<MavenPublishPlugin> {
configure<PublishingExtension> {
repositories {
maven {
url = if (version.toString().endsWith("-SNAPSHOT")) {
uri("https://repo.openrs2.dev/repository/openrs2-snapshots")
} else {
uri("https://repo.openrs2.dev/repository/openrs2")
}
credentials {
username = findProperty("openrs2RepoUsername")?.toString()
password = findProperty("openrs2RepoPassword")?.toString()
}
}
}
publications.withType<MavenPublication> {
artifactId = "openrs2-${project.name}"
pom {
url.set("https://www.openrs2.dev/")
inceptionYear.set("2019")
organization {
name.set("OpenRS2 Authors")
url.set("https://www.openrs2.dev/")
}
licenses {
license {
Switch to the ISC license I've been considering this for a long time, and have decided to switch to it at the last minute before opening the repository up publicly. My reasons include: * It's a much simpler license. GPL's complexity adds some risk - for example, it might be incompatible with future open-source licenses (like the well-known GPLv2/Apache v2 incompatibility problem). The "or any later version" clause requires placing some trust in the Free Software Foundation. * The simplicity makes it easier for people to understand and comply with the license. * Dishonest users who disobey the GPL would have an advantage over honest users who refuse to do so. The ISC license provides a much more even playing field. * OpenRS2 will primarily be server software accessible over a network. As such, the GPL can do little to prevent use of the code in a proprietary system, as the code is never distributed. (While the AGPL would fix this, I have already discounted it. Enforcement would be too difficult and dishonest users would have an unfair advantage.) * It's much easier to switch to a stricter license in future versions, if it turns out that is desirable (as the ISC license allows users to sublicense the code). However, switching from the GPL to the ISC license requires all copyright holders to grant permission. * Other open-source projects in the community, such as Apollo, use the ISC license and will be able to make use of OpenRS2 code if they so desire. I've removed the FAQ entry about the reasons for using the GPL license, as I think the ISC license is less controversial and therefore does not require an entry. I've discussed this with Desetude, and he's okay with his commit being relicensed.
4 years ago
name.set("ISC License")
url.set("https://opensource.org/licenses/ISC")
}
}
scm {
connection.set("scm:git:https://git.openrs2.dev/openrs2/openrs2.git")
developerConnection.set("scm:git:git@git.openrs2.dev:openrs2/openrs2.git")
url.set("https://git.openrs2.dev/openrs2/openrs2")
}
issueManagement {
system.set("Gitea")
url.set("https://git.openrs2.dev/openrs2/openrs2")
}
ciManagement {
system.set("Jenkins")
url.set("https://build.openrs2.dev/job/openrs2/")
}
}
}
}
}
}
val rejectVersionRegex = Regex("(?i)[._-](?:alpha|beta|rc|cr|m)")
tasks.withType<DependencyUpdatesTask> {
gradleReleaseChannel = "current"
revision = "release"
rejectVersionIf {
candidate.version.contains(rejectVersionRegex)
}
}