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
84 lines (64 loc) · 2.14 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
75
76
77
78
79
80
81
82
83
84
apply plugin: 'maven-publish'
def outputsFolder = file("$project.buildDir/outputs")
def libraryName = "NavxSimulation"
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)
def createAllTask
if(!project.hasProperty('ciBuild')) {
createAllTask = createAllCombined(project.packageNativeFilesInJar, "", "", Jar, project)
}
publications {
snobot_sim_java(MavenPublication) {
groupId 'com.snobot.simulator'
artifactId "navx_simulator"
version release_version
artifact jar
artifact javadocJar
artifact sourcesJar
jniLibraryTaskList.each {
artifact it
}
artifact cppHeadersZip
artifact cppSourcesZip
artifact project.packageNativeFilesInJar
if(!project.hasProperty('ciBuild')) {
artifact createAllTask
}
}
}
}
}