forked from CIRDLES/Squid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.gradle
132 lines (104 loc) · 3.45 KB
/
common.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//
// This file is to be applied to every subproject.
//
apply plugin: 'java'
apply plugin: 'maven-publish'
String mavenGroupId = 'org.cirdles'
String mavenVersion = '2.0.9'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
flatDir {
dirs 'libs'
}
}
dependencies {
// Adding dependencies here will add the dependencies to each subproject.
implementation group: 'gov.nist.math', name: 'jama', version: '1.0.3'
implementation 'com.github.cirdles:LudwigLibrary:-SNAPSHOT'
implementation "com.sun.activation:javax.activation:1.2.0"
implementation "javax.xml.bind:jaxb-api:2.3.1"
// https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-core
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: '3.0.2'
// https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.1'
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core
implementation("org.apache.logging.log4j:log4j-core:2.18.0")
testImplementation "junit:junit:4.13.2"
testImplementation "org.assertj:assertj-core:3.18.1"
}
String mavenArtifactId = name
group = mavenGroupId
version = mavenVersion
task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveClassifier.set("sources")
from sourceSets.main.allSource
}
task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
archiveClassifier.set("javadoc")
}
artifacts {
archives jar
archives sourcesJar
// Uncomment next line to produce javadocs
// archives packageJavadoc
}
// refer to https://github.com/renatoathaydes/rawhttp/blob/master/rawhttp-core/build.gradle#L72
// refer to https://docs.gradle.org/current/userguide/publishing_maven.html
publishing {
publications {
maven(MavenPublication) {
groupId = mavenGroupId
artifactId = mavenArtifactId
version = mavenVersion
// description = "Java Port of Squid2.5"
from components.java
pom {
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
}
}
}
}
task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
sourceSets*.allSource*.srcDirs*.each { File srcDir ->
if (!srcDir.isDirectory()) {
println "Creating source folder: ${srcDir}"
srcDir.mkdirs()
}
}
}
tasks.withType(JavaCompile) {
configure(options) {
options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked'
}
println 'Compiler args: ' + options.compilerArgs
}
javadoc {
options.tags = [
'pre:a:Precondition:',
'post:a:Postcondition:',
'imports:a:Imports libraries:',
'author:a:Author:'
]
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}