forked from sunspec/models
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
89 lines (71 loc) · 2.38 KB
/
build.gradle.kts
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
import edu.rit.gis.sunspec.gradle.SunSpecGen
group = "edu.rit.gis.sunspec"
version = "1.0-SNAPSHOT"
/*
* TO PUBLISH: gradle publishToMavenLocal
*/
plugins {
kotlin("jvm") version "1.5.30" apply true
`java-library` apply true
java
`maven-publish` apply true
kotlin("plugin.serialization") version "1.5.30"
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.4.21")
constraints {
implementation("org.jetbrains.kotlin:kotlin-reflect:1.4.21")
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xuse-experimental=kotlin.ExperimentalUnsignedTypes"
}
}
tasks.register<SunSpecGen>("generate-models") {
inputDir = "$projectDir/models"
pkg = "edu.rit.gis.sunspec.models"
annotationsPkg = "edu.rit.gis.sunspec.annotations.*"
outputDir = "$projectDir/src/main/kotlin/edu/rit/gis/sunspec/models"
}
/* To publish locally, run: gradle publishToMavenLocal */
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
name.set("Kotlin SunSpec Models")
description.set("Annotated kotlin implementation of SunSpec register definitions")
artifactId = "sunspec-kotlin"
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("cepasp")
name.set("Christopher Piggott")
email.set("[email protected]")
}
}
// scm {
// connection.set("scm:git:git://example.com/my-library.git")
// developerConnection.set("scm:git:ssh://example.com/my-library.git")
// url.set("http://example.com/my-library/")
// }
}
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
defaultTasks("generate-models", "build", "publishToMavenLocal")