diff --git a/build.gradle b/build.gradle index d4d1583..162efc1 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..b126cc3 --- /dev/null +++ b/build.properties @@ -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 \ No newline at end of file