This repository has been archived by the owner on Jan 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.gradle
74 lines (56 loc) · 1.74 KB
/
publish.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
apply plugin: 'maven-publish'
def outputsFolder = file("$project.buildDir/outputs")
def libraryName = "SparkMaxDriver"
def artifactGroupId = "edu.wpi.first.${libraryName}"
def zipBaseName = "_GROUP_edu_wpi_first_${libraryName}_ID_${libraryName}-cpp_CLS"
def jniBaseName = "_GROUP_edu_wpi_first_${libraryName}_ID_${libraryName}-jni_CLS"
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task cppHeadersZip(type: Zip) {
destinationDir = outputsFolder
baseName = zipBaseName
classifier = "headers"
from("$rootDir/src/main/native/include") {
into '/'
}
}
task cppSourcesZip(type: Zip) {
destinationDir = outputsFolder
baseName = zipBaseName
classifier = "sources"
from("$rootDir/src/main/native/cpp") {
into '/'
}
}
ext.maven_publishing_path = "$rootDir/build/maven_repo/"
model {
publishing {
repositories {
maven {
url "build/maven_repo"
}
}
def jniLibraryTaskList = createComponentZipTasks($.components, [libraryName], zipBaseName, Zip, project, includeStandardZipFormat)
publications {
rev_simulator(MavenPublication) {
groupId 'com.snobot.simulator'
artifactId "rev_simulator"
version release_version
artifact jar
artifact javadocJar
artifact sourcesJar
jniLibraryTaskList.each {
artifact it
}
artifact cppHeadersZip
artifact cppSourcesZip
}
}
}
}