-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
121 lines (107 loc) · 3.31 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
plugins {
`java-library`
`ivy-publish`
`maven-publish`
signing
}
group = "com.wooruang"
version = "0.1.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
dependencies {
testCompile("junit", "junit", "4.12")
}
project.extra["dynamicLibFile"] = ""
val libCopy by tasks.registering(Copy::class) {
dependsOn(":jnng-native:build")
val dynamicLibFileForUbuntu = file(project.extra["dynamicLibFileForUbuntu"].toString())
val dynamicLibFileForMacOS = file(project.extra["dynamicLibFileForMacOS"].toString())
val destLibsDir = file("$buildDir/classes/java/main/libs")
// println("libCopy $dynamicLibFile")
// System.out.flush()
from(dynamicLibFileForUbuntu, dynamicLibFileForMacOS)
into(destLibsDir)
}
tasks.compileJava {
dependsOn(libCopy)
}
tasks.register<Jar>("sourcesJar") {
from(sourceSets.main.get().allJava)
archiveClassifier.set("sources")
}
tasks.register<Jar>("javadocJar") {
from(tasks.javadoc)
archiveClassifier.set("javadoc")
}
publishing {
publications {
create<IvyPublication>("ivy") {
from(components["java"])
}
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("jnng")
description.set("This project is a wrapper of nng(nanomsg-next-generation) by using JNI for JVM")
url.set("https://github.com/wooruang")
licenses {
license {
name.set("MIT License")
url.set("http://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("wooruang")
name.set("HanSaem")
email.set("wooruang@gmail.com")
}
}
scm {
connection.set("scm:git:git://github.com/wooruang/jnng.git")
developerConnection.set("scm:git:git@github.com:wooruang/jnng.git")
url.set("https://github.com/wooruang/jnng")
}
}
}
}
repositories {
ivy {
url = uri("${System.getProperty("user.home")}/.ivy2/local")
layout("ivy")
}
mavenCentral()
maven {
credentials {
username = project.properties["nexusUsername"].toString()
password = project.properties["nexusPassword"].toString()
}
name = "ossrh-snapshot"
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
maven {
credentials {
username = project.properties["nexusUsername"].toString()
password = project.properties["nexusPassword"].toString()
}
name = "ossrh-staging-for-release"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
}
}
signing {
sign(publishing.publications["maven"])
}
task("go-server") {
dependsOn(":build-native-make")
dependsOn(":jnng-server:run")
}
task("go-client") {
dependsOn(":build-native-make")
dependsOn(":jnng-client:run")
}