forked from multi-os-engine/moe-plugin-gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
175 lines (142 loc) · 4.92 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
Copyright (C) 2016 Migeran
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id "org.jetbrains.kotlin.jvm"
id "maven-publish"
id "signing"
}
if (name != 'moe-gradle') {
throw new GradleException('Incorrect name')
}
group 'org.multi-os-engine'
String loadPluginVersion() {
final Properties props = new Properties()
props.load(new FileInputStream(file('src/main/resources/org/moe/gradle/moe.properties')))
return props.getProperty('MOE-Plugin-Version')
}
version loadPluginVersion()
sourceCompatibility = 1.8
targetCompatibility = 1.8
configurations {
included
}
dependencies {
compile gradleApi()
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
compile group: 'commons-io', name: 'commons-io', version: '2.4'
compile group: 'com.jcraft', name: 'jsch', version: '0.1.53'
compile group: 'org.ow2.asm', name: 'asm', version: '5.1'
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
compile group: 'com.googlecode.plist', name: 'dd-plist', version: '1.19'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile gradleTestKit()
testCompile project(':moe.generator.project')
compileOnly project(':moe.tools.common')
compileOnly project(':moe.document.pbxproj')
compileOnly project(':moe.generator.project')
included project(':moe.tools.common')
included project(':moe.document.pbxproj')
included project(':moe.generator.project')
}
tasks.test.dependsOn ':moe-sdk:devsdk'
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact(javadocJar)
artifact(sourceJar)
artifactId = 'moe-gradle'
pom {
name = 'moe-gradle'
packaging = 'jar'
description = 'MOE Gradle Plugin'
url = 'https://discuss.multi-os-engine.org'
scm {
url = 'https://github.com/multi-os-engine/moe-plugin-gradle'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'MOE'
name = 'Multi-OS Engine Dev'
organization = 'Multi-OS Engine'
organizationUrl = 'https://www.multi-os-engine.org/'
}
}
}
}
}
repositories {
maven {
name = 'MavenCentral'
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
if (project.hasProperty('ossrhUsername')) {
username = ossrhUsername
}
if (project.hasProperty('ossrhPassword')) {
password = ossrhPassword
}
}
}
}
}
if (project.hasProperty("signing.keyId")) {
signing {
sign publishing.publications.mavenJava
}
}
jar {
from { configurations.included.collect { it.isDirectory() ? it : zipTree(it) } }
}
// Write the plugin's classpath to a file to share with the tests
task createClasspathManifest {
def outputDir = file("$buildDir/$name")
inputs.files sourceSets.main.runtimeClasspath
outputs.dir outputDir
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").text = (sourceSets.main.runtimeClasspath + configurations.included).join("\n")
file("$outputDir/plugin-sdk-localbuild.txt").text = project(':moe-sdk').file('build/dev-sdk')
file("$outputDir/plugin-version.txt").text = project.version
}
}
// Add the classpath file to the test runtime classpath
dependencies {
testRuntime files(createClasspathManifest)
}
compileKotlin {
kotlinOptions {
jvmTarget = '1.8'
}
}