-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
110 lines (90 loc) · 2.56 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
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
mavenLocal()
jcenter()
}
dependencies {
classpath 'net.saliman:gradle-properties-plugin:1.5.1'
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'net.saliman.properties'
def vcsurl = 'https://github.com/halodi/halodi-robot-models'
group = "com.halodi"
def inputVersion= project.hasProperty("artifactVersion") ?
project.getProperty("artifactVersion"): System.getenv('ARTIFACT_VERSION')
version = "$inputVersion$versionAppendix"
def repoUrl = "https://artifacts.halodi.com/repository"
def excludedFiles = [ '**/build', '**/cmake', '**/CMakeLists.txt', '**/package.xml', '**/model.config', '**/urdf.in', 'unity' ]
sourceSets {
main {
java {
srcDirs = []
}
resources {
srcDirs = []
}
}
}
jar {
file(".").eachFile(groovy.io.FileType.DIRECTORIES) {
def packageFile = new File(it, "package.xml");
if(packageFile.exists()) {
def targetPackage = 'com/halodi/models/' + it.name;
def sourceFolder = file(it);
into targetPackage, {
from sourceFolder
exclude excludedFiles
}
}
}
}
// Create the pom configuration:
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
name "Jesper Smith"
email "[email protected]"
}
}
scm {
url vcsurl
}
}
// Create the publication with the pom configuration:
publishing {
publications {
JavaPublication(MavenPublication) {
from components.java
groupId group
artifactId project.name
version version
}
}
}
publishing {
repositories {
maven {
def inputUsername = project.hasProperty("artifactUsername") ?
project.getProperty("artifactUsername"): System.getenv('ARTIFACT_USERNAME')
def inputPassword = project.hasProperty("artifactPassword") ?
project.getProperty("artifactPassword"): System.getenv('ARTIFACT_PASSWORD')
credentials {
username inputUsername
password inputPassword
}
url "$repoUrl$repository"
}
}
}