-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
160 lines (141 loc) · 4.6 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
plugins {
id 'groovy'
id 'java'
id 'java-gradle-plugin'
id 'idea'
id 'maven-publish'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
id 'com.gradle.plugin-publish' version '0.14.0'
id 'signing'
}
def defGroupId = 'com.appland'
def defArtifactId = 'appmap-gradle-plugin'
def defName = 'AppMap Gradle Plugin'
def defVersion = "1.2.0"
def defDescription = 'Gradle plugin to record AppMaps'
def defGitSlug = "applandinc/appmap-gradle-plugin"
def defMavenRepo = 'https://s01.oss.sonatype.org'
def paramSignKey = findProperty('signingKey')
def paramSignPassword = findProperty("signingPassword")
def paramRepoUsername = findProperty('ossrhUsername')
def paramRepoPassword = findProperty('ossrhPassword')
def paramGradleKey = findProperty('gradlePublishKey')
def paramGradleSecret = findProperty('gradlePublishSecret')
def paramDescription = findProperty('artifactDescription') ?: defDescription
def paramName = findProperty('artifactName') ?: defName
def paramGroupId = findProperty('publicationGroupId') ?: defGroupId
def paramGitSlug = System.getenv("TRAVIS_REPO_SLUG") ?: defGitSlug
def paramMavenRepo = findProperty('mavenRepo') ?: defMavenRepo
def paramVersion = findProperty('paramVersion')
def travisVersion = System.getenv("TRAVIS_BRANCH")
def versionLikeRegexp = /^\d+\.\d+.*/
def travisVersionOK = travisVersion && (travisVersion ==~ versionLikeRegexp)
paramVersion = paramVersion ?: (travisVersionOK ? travisVersion : defVersion)
if (findProperty('snapshot') != null) {
paramVersion += '-SNAPSHOT'
}
println "version:$paramVersion"
version = paramVersion
group = paramGroupId
test {
useJUnitPlatform()
}
repositories {
mavenCentral()
}
dependencies {
gradleApi()
localGroovy()
testImplementation(enforcedPlatform("org.junit:junit-bom:5.10.0")) // JUnit 5 BOM
testImplementation("org.junit.jupiter:junit-jupiter")
implementation 'com.appland:appmap-agent:[1.3, 2.0)'
implementation 'commons-lang:commons-lang:2.6'
implementation 'com.google.guava:guava:30.1.1-jre'
implementation 'org.assertj:assertj-core:3.15.0'
}
project.ext.set('gradle.publish.key', paramGradleKey)
project.ext.set('gradle.publish.secret', paramGradleSecret)
pluginBundle {
website = 'https://appland.com'
vcsUrl = "https://github.com/${paramGitSlug}"
tags = [
'architecture',
'code analysis',
'diagram',
'diff',
'security',
'software',
'design',
'technical',
'debt',
'trace',
'uml',
'visualization'
]
}
gradlePlugin {
plugins {
appmapPlugin {
id = 'com.appland.appmap'
displayName = 'AppMap plugin'
description = 'Interactive maps and architecture analysis to help you write better Java.'
implementationClass = 'com.appland.appmap.gradle.AppMapPlugin'
}
}
}
apply plugin: 'java'
java {
withSourcesJar()
withJavadocJar()
}
apply plugin: 'maven-publish'
publishing {
publications {
withType(MavenPublication) {
pom {
name = paramName
description = paramDescription
version = paramVersion
url = "https://appland.com"
licenses {
license {
name = "MIT"
url = "https://raw.githubusercontent.com/$paramGitSlug/master/LICENSE"
}
}
developers {
developer {
name = "Kevin Gilpin"
email = "[email protected]"
organization = "AppLand Inc."
url = "https://dev.to/kgilpin"
}
}
scm {
connection = "scm:git:git://github.com/${paramGitSlug}.git"
developerConnection = "scm:git:ssh://github.com:${paramGitSlug}.git"
url = "https://github.com/${paramGitSlug}/tree/master"
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri(paramMavenRepo + "/service/local/")
snapshotRepositoryUrl = uri(paramMavenRepo + "/content/repositories/snapshots")
username = paramRepoUsername
password = paramRepoPassword
}
}
}
if (project.hasProperty("signingKey")) {
apply plugin: 'signing'
signing {
def signingKey = paramSignKey
def signingPassword = paramSignPassword
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
}
}