-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
86 lines (77 loc) · 2.63 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
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "${gradle_rio_version}"
id "maven-publish"
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
javadoc {
source = sourceSets.main.allJava
classpath = sourceSets.main.runtimeClasspath
}
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 4.
dependencies {
implementation "edu.wpi.first.wpilibj:wpilibj-java:${wpi.wpilibVersion}"
}
ext {
jarToPublish = file( "${project.artifact_name}.jar" )
}
jar {
baseName "${project.artifact_name}"
}
task sourceJar(type: Jar, dependsOn: classes) {
baseName "${project.artifact_name}"
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
baseName "${project.artifact_name}"
classifier = 'javadoc'
from javadoc.destinationDir
}
task replaceVersionInREADME {
ant.replaceregexp(match:"${project.artifact_group}:${project.artifact_name}:([0-9\\.]+)", replace:"${project.artifact_group}:${project.artifact_name}:${project.artifact_version}", flags:'g', byline:true, encoding: 'UTF-8') {
fileset(dir: '.', includes: 'README.md')
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
artifact javadocJar
groupId = "${project.artifact_group}"
artifactId = "${project.artifact_name}"
version = "${project.artifact_version}"
pom {
name = 'Pixy2JavaAPI'
description = 'Java port of Pixy2 API for FIRST Robotics'
url = 'https://github.com/PseudoResonance/Pixy2JavaAPI/'
licenses {
license {
name = 'GNU General Public License, version 2'
url = 'http://www.gnu.org/licenses/gpl-2.0.html'
}
}
developers {
developer {
id = 'PseudoResonance'
name = 'Josh Otake'
email = 'kaio11602@gmail.com'
}
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/PseudoResonance/Pixy2JavaAPI"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}