forked from ausbin/circuitsim-grader-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
103 lines (88 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// In this section you declare where to find the dependencies of your project
plugins {
// Apply the java plugin to add support for Java
id 'java'
id 'java-library'
// Produce maven packages for easy inclusion
id 'maven-publish'
id 'com.palantir.git-version' version "0.12.3"
}
group = 'io.zucchini.circuitsim-tester'
version gitVersion()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
}
configurations {
includedLibs
}
dependencies {
includedLibs files('./CircuitSim.jar')
implementation files('./CircuitSim.jar')
api 'org.junit.jupiter:junit-jupiter-api:5.2.0'
api 'org.junit.jupiter:junit-jupiter-params:5.2.0'
api 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
api 'org.junit.platform:junit-platform-launcher:1.2.0'
}
compileJava {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
jar {
manifest {
attributes('Main-Class': "io.zucchini.circuitsimtester.launcher.TesterLauncher")
}
// Include dependencies
from { configurations.includedLibs.collect { it.isDirectory() ? it : zipTree(it) } }
}
javadoc {
title 'CircuitSim Autograder API'
include 'io/zucchini/circuitsimtester/api/*', 'io/zucchini/circuitsimtester/extension/*'
// For github pages
destinationDir = file('docs')
options.addBooleanOption 'html5', true
options.addStringOption 'link', 'https://docs.oracle.com/en/java/javase/17/docs/api/'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
// Create the publication with the pom configuration:
publishing {
publications {
MavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId project.name
version project.version
pom.withXml {
asNode().dependencies.dependency.each { dep ->
if (dep.artifactId.last().value().last().contains("CircuitSim")) {
assert dep.parent().remove(dep)
}
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/zucchini/circuitsim-tester"
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
}
}
}
}