Clean up buildscript & add JB annotations as well as a proper build config

This commit is contained in:
Alexander Hinze 2021-09-25 20:22:25 +02:00
parent 3fc6bed79a
commit 9c09f2ee70
2 changed files with 42 additions and 19 deletions

View File

@ -1,9 +1,7 @@
plugins {
id 'java-library'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
buildscript {
def config = new Properties()
file('build.properties').withInputStream(config.&load)
project.ext.config = config
}
apply plugin: 'java'
@ -12,24 +10,31 @@ apply plugin: 'maven'
repositories {
mavenCentral()
google()
maven {
url = "https://maven.speiger.com/repository/main"
}
}
archivesBaseName = 'Primitive Collections'
version = '0.4.0';
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
archivesBaseName = config.project_name
version = config.project_version
group = config.project_group
sourceCompatibility = config.java_source_version
targetCompatibility = config.java_target_version
javadoc {
options.tags = [ "implSpec", "note" ]
options.tags = [ "implSpec", "note" ]
failOnError = false
options.memberLevel = JavadocMemberLevel.PUBLIC
options.quiet()
}
eclipse {
classpath {
downloadJavadoc = true
downloadSources = true
file {
whenMerged {
//Enforce a custom container and allowing access to the sun.misc package which is nessesary for EnumMaps
@ -39,6 +44,12 @@ eclipse {
}
}
tasks.withType(JavaCompile) {
sourceCompatibility = config.java_source_version
targetCompatibility = config.java_target_version
options.encoding = 'UTF-8'
}
compileJava {
options.compilerArgs << '-XDignore.symbol.file'
options.fork = true
@ -54,8 +65,11 @@ configurations {
}
dependencies {
builderCompile 'de.speiger:Simple-Code-Generator:1.0.4'
runtimeOnly 'de.speiger:Simple-Code-Generator:1.0.4'
implementation group: 'org.jetbrains', name: 'annotations', version: config.annotations_version
builderCompile group: 'de.speiger', name: 'Simple-Code-Generator', version: config.scg_version
runtimeOnly group: 'de.speiger', name: 'Simple-Code-Generator', version: config.scg_version
testImplementation 'junit:junit:4.12'
}
@ -84,10 +98,6 @@ task srcJar(type: Jar) {
classifier = 'sources'
}
javadoc.failOnError = false
javadoc.options.memberLevel = JavadocMemberLevel.PUBLIC
javadoc.options.quiet()
artifacts {
archives javadocJar
archives srcJar
@ -107,8 +117,8 @@ uploadArchives {
}
pom {
version = project.version
artifactId = project.archivesBaseName.replace(" ", "-")
groupId = 'de.speiger'
artifactId = config.artifact_id
groupId = config.artifact_group
project {
licenses {
license {

13
build.properties Normal file
View File

@ -0,0 +1,13 @@
project_name=PrimitiveCollections
project_id=primitivecollections
project_group=speiger.src.collections
project_version=0.4.0
artifact_group=de.speiger
artifact_id=Primitive-Collections
java_source_version=11
java_target_version=8
annotations_version=22.0.0
scg_version=1.0.4