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