aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle.kts
blob: 491c90f5bb19313dda0d684529415a9a5ad8e484 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
 * This file was generated by the Gradle 'init' task.
 *
 * This generated file contains a sample Kotlin library project to get you started.
 * For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.10.2/userguide/building_java_projects.html in the Gradle documentation.
 * This project uses @Incubating APIs which are subject to change.
 */

plugins {
    // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
    alias(libs.plugins.kotlin.jvm)

    // Apply the java-library plugin for API and implementation separation.
    `java-library`
    id("maven-publish")
    id("net.researchgate.release") version "3.0.2"
}

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

dependencies {
}

testing {
    suites {
        // Configure the built-in test suite
        val test by getting(JvmTestSuite::class) {
            // Use Kotlin Test test framework
            useKotlinTest("2.0.0")
        }
    }
}

// Apply a specific Java toolchain to ease working on different environments.
java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(11)
    }
}

publishing {
    publications {
        create<MavenPublication>("maven") {
            from(components["java"])
            groupId = "io.github.locusts-r-us"
            artifactId = "locusts"
            version = "$version"
            pom {
                name = "Locusts"
                description = "A JVM library that introduces locusts into your codebase."
                licenses {
                    license {
                        name = "Zero-Clause BSD"
                        url = "https://spdx.org/licenses/0BSD.html"
                    }
                }
                developers {
                    developer {
                        id = "rosstheross"
                        name = "Matt Strapp"
                        email = "matt@mattstrapp.net"
                    }
                }
                scm {
                    connection = "scm:git:https://github.com/locusts-r-us/locusts.git"
                    developerConnection = "scm:git:ssh://github.com/locusts-r-us/locusts.git"
                    url = "https://github.com/locusts-r-us/locusts"
                }
            }
        }
    }
    repositories {
        maven {
            name = "GitHubPackages"
            url = uri("https://maven.pkg.github.com/locusts-r-us/locusts")
            credentials {
                username = System.getenv("GITHUB_ACTOR")
                password = System.getenv("GITHUB_TOKEN")
            }
        }
        maven {
            name = "OSSRH"
            url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
            credentials {
                username = System.getenv("MAVEN_USERNAME")
                password = System.getenv("MAVEN_PASSWORD")
            }
        }
    }
}

release {
    git {
        requireBranch = "master"
    }
}