-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
49 lines (40 loc) · 1.14 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
apply plugin : 'maven'
ext.depVars = {}
def depProperties = ['depGroup', 'depVersion', 'depArtifact', 'depFile']
def usageMsg = "Usage: gradle "
def missingProperties = []
depProperties.each {
if (!project.hasProperty(it)) {
missingProperties += [it]
} else {
depVars[it] = (String) property(it)
}
usageMsg += "-P${it}=... "
}
if (missingProperties.size > 0) {
throw new GradleException( "One or more properties were missing. Missing: ${missingProperties.join(' ')}.\n${usageMsg}")
}
def depFile;
def depFilePath = depVars['depFile']
[ file(depFilePath), new File(depFilePath) ].each {
if (it.isFile()) {
depFile = it
}
}
if (depFile == null) {
throw new GradleException("No file could be found at ${depFilePath} (Note: using ~ in the path won't work)")
}
artifacts {
archives file: depFile, name: depVars['depArtifact']
}
uploadArchives {
repositories {
mavenDeployer {
repository ( url: "file://localhost${projectDir}/repo" )
pom.version = depVars['depVersion']
pom.artifactId = depVars['depArtifact']
pom.groupId = depVars['depGroup']
}
}
}
defaultTasks 'uploadArchives'