forked from sertain/sertain-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
112 lines (94 loc) · 3.28 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
buildscript {
ext.kotlinVersion = '1.2.50'
ext.dokkaVersion = '0.9.17'
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'http://first.wpi.edu/FRC/roborio/maven/release' }
maven { url 'https://raw.githubusercontent.com/Open-RIO/Maven-Mirror/master/m2' }
maven { url 'http://dev.imjac.in/maven/' }
}
apply plugin: 'kotlin'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.dokka'
// No-op if it's the root lib
if (project == project.rootProject) return
// Task to generate sources JAR
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.kotlin.srcDirs
}
// Use tasks above to define artifacts
artifacts {
archives sourcesJar
}
dokka {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadocs"
linkMapping {
dir = 'src/main/kotlin'
url = 'https://github.com/sertain/sertain/tree/master/core/src/main/kotlin'
suffix = '#L'
}
externalDocumentationLink {
url = new URL('https://www.ctr-electronics.com/downloads/api/java/html/')
}
externalDocumentationLink {
url = new URL('http://first.wpi.edu/FRC/roborio/release/docs/java/')
}
}
publishing {
// By passing -Pcustom_local=/some/path and running the
// publishLibraryPublicationToCustomLocalRepository task you can publish this library to a
// custom maven repository location on your machine.
repositories {
maven {
name 'CustomLocal'
url uri(project.hasProperty('custom_local') ? project.getProperty('custom_local') : '/tmp/')
}
}
repositories {
maven {
name 'BuildLocal'
url "$buildDir/repo"
}
}
}
publishing {
publications {
"${project.name}"(MavenPublication) {
groupId "org.sert2521"
artifactId project.name
version "1.2.1"
artifact "$buildDir/libs/${project.name}.jar"
artifact sourcesJar
pom.withXml {
// Dependencies
def dependenciesNode = asNode().getAt("dependencies")[0]
if (dependenciesNode == null) {
dependenciesNode = asNode().appendNode("dependencies")
}
// Add all that are 'compile'
configurations.compile.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}