Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/api/build.gradle.kts
blob: 135708ed24d66a420860c2188070c5ac86c7e459 (plain)
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
/*
 * SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
 * SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0
 */

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

// The API that plugins of the Tazel project file compile against: com.progmasoft.api.tazel and its
// packages, published as com.progmasoft.tazel:tazel-api to https://maven.progmasoft.com/tazel.
// A plugin does not bundle it; Tazel provides it at run time.
plugins {
  kotlin("jvm")
  `java-library`
  `maven-publish`
}

group = "com.progmasoft.tazel"
version = rootProject.version

repositories {
  mavenCentral()
}

kotlin {
  jvmToolchain(25)
  compilerOptions {
    jvmTarget = JvmTarget.JVM_25
    allWarningsAsErrors = true
  }
}

java {
  sourceCompatibility = JavaVersion.VERSION_25
  targetCompatibility = JavaVersion.VERSION_25
  withSourcesJar()
}

sourceSets {
  main { kotlin.srcDir("sources/main/kotlin") }
}

tasks.withType<AbstractArchiveTask>().configureEach {
  isPreserveFileTimestamps = false
  isReproducibleFileOrder = true
}

tasks.jar {
  manifest {
    attributes("Implementation-Title" to "Tazel API", "Implementation-Version" to project.version)
  }
}

publishing {
  publications {
    create<MavenPublication>("api") {
      artifactId = "tazel-api"
      from(components["java"])
      pom {
        name = "Tazel API"
        description = "The API that plugins of the Tazel project file compile against."
        url = "https://tazel.net/"
        licenses {
          license {
            name = "MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0"
            url = "https://github.com/Progmasoft/tazel/blob/main/LICENSE.txt"
          }
        }
        developers {
          developer {
            name = "Progmasoft"
            email = "support@progmasoft.com"
          }
        }
        scm {
          url = "https://github.com/Progmasoft/tazel"
          connection = "scm:git:https://github.com/Progmasoft/tazel.git"
        }
      }
    }
  }
  repositories {
    // A local repository, which is copied to https://maven.progmasoft.com/tazel.
    maven {
      name = "staging"
      url =
        rootProject.layout.buildDirectory
          .dir("maven")
          .get()
          .asFile
          .toURI()
    }
  }
}