forked from cretz/kastree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (142 loc) · 5.17 KB
/
build.gradle
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
buildscript {
ext.kotlin_version = '1.3.21'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
group 'com.github.cretz.kastree'
version '0.5.0-SNAPSHOT'
repositories {
mavenCentral()
}
}
project(':ast:ast-common') {
apply plugin: 'kotlin-platform-common'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
}
publishSettings(project, 'kastree-ast-common', 'Common library for Kastree AST')
}
project(':ast:ast-jvm') {
apply plugin: 'kotlin-platform-jvm'
sourceCompatibility = '1.8'
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}
dependencies {
expectedBy project(':ast:ast-common')
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
}
test {
testLogging {
outputs.upToDateWhen {false}
showStandardStreams = true
exceptionFormat = 'full'
events 'passed', 'skipped', 'failed'
}
}
publishSettings(project, 'kastree-ast-jvm', 'JVM library for Kastree AST')
}
project(':ast-psi') {
apply plugin: 'kotlin'
sourceCompatibility = '1.8'
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}
dependencies {
compile project(':ast:ast-jvm')
compile 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
compile "org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlin_version"
testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
}
test {
testLogging {
outputs.upToDateWhen {false}
showStandardStreams = true
exceptionFormat = 'full'
events 'passed', 'skipped', 'failed'
}
}
publishSettings(project, 'kastree-ast-psi', 'JVM library Kastree parsing')
}
def publishSettings(project, projectName, projectDescription) {
project.with {
if (!project.hasProperty('ossrhUsername')) return
apply plugin: 'maven'
apply plugin: 'signing'
archivesBaseName = projectName
task packageSources(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
if (project.name.endsWith('-jvm') || project.name.endsWith('-js')) {
duplicatesStrategy = 'exclude'
def commonProject = project.parent.subprojects.find { it.name.endsWith('-common') }
from(sourceSets.main.allSource + commonProject.sourceSets.main.allSource)
}
}
task packageJavadoc(type: Jar) {
// Empty to satisfy Sonatype's javadoc.jar requirement
classifier 'javadoc'
}
artifacts {
archives packageSources, packageJavadoc
}
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name projectName
packaging 'jar'
description projectDescription
url 'https://github.com/cretz/kastree'
scm {
connection 'scm:git:[email protected]:cretz/kastree.git'
developerConnection 'scm:git:[email protected]:cretz/kastree.git'
url '[email protected]:cretz/kastree.git'
}
licenses {
license {
name 'MIT License'
url 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'cretz'
name 'Chad Retz'
url 'https://github.com/cretz'
}
}
}
}
}
}
}
}