2021-01-20 04:29:08 +01:00
|
|
|
plugins {
|
|
|
|
id 'java-library'
|
2022-06-14 08:55:40 +02:00
|
|
|
id "jacoco"
|
2021-01-20 04:29:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
}
|
|
|
|
|
2021-01-28 20:42:29 +01:00
|
|
|
apply plugin: 'java'
|
2021-01-25 05:48:14 +01:00
|
|
|
apply plugin: 'eclipse'
|
2022-04-07 16:00:58 +02:00
|
|
|
apply plugin: 'maven-publish'
|
2021-01-25 05:48:14 +01:00
|
|
|
|
2021-01-28 20:42:29 +01:00
|
|
|
repositories {
|
2021-06-22 15:15:10 +02:00
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
url = "https://maven.speiger.com/repository/main"
|
2021-01-28 20:42:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-27 17:17:51 +02:00
|
|
|
archivesBaseName = 'Primitive Collections'
|
2022-12-20 09:33:26 +01:00
|
|
|
version = '0.8.0';
|
2021-04-27 17:17:51 +02:00
|
|
|
|
2022-04-07 20:26:53 +02:00
|
|
|
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaVersion.current();
|
2021-01-28 20:42:29 +01:00
|
|
|
|
2022-04-07 20:26:53 +02:00
|
|
|
System.out.println("Java Version: "+compileJava.sourceCompatibility)
|
2022-04-07 20:19:47 +02:00
|
|
|
|
2021-04-22 23:02:04 +02:00
|
|
|
javadoc {
|
|
|
|
options.tags = [ "implSpec", "note" ]
|
|
|
|
}
|
|
|
|
|
2021-01-20 04:29:08 +01:00
|
|
|
eclipse {
|
|
|
|
classpath {
|
|
|
|
downloadJavadoc = true
|
|
|
|
downloadSources = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-29 11:41:48 +01:00
|
|
|
sourceSets {
|
|
|
|
builder
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
builderCompile.extendsFrom compile
|
2021-01-20 04:29:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-12-02 22:36:34 +01:00
|
|
|
builderImplementation 'com.google.code.gson:gson:2.10'
|
2022-12-16 18:17:51 +01:00
|
|
|
builderImplementation 'de.speiger:Simple-Code-Generator:1.2.2'
|
2021-01-20 04:29:08 +01:00
|
|
|
testImplementation 'junit:junit:4.12'
|
2021-12-10 05:54:37 +01:00
|
|
|
testImplementation 'com.google.guava:guava-testlib:31.0.1-jre'
|
2022-04-19 16:58:22 +02:00
|
|
|
|
2021-01-20 04:29:08 +01:00
|
|
|
}
|
|
|
|
|
2021-01-29 11:41:48 +01:00
|
|
|
task generateSource(type: JavaExec) {
|
|
|
|
group = 'internal'
|
|
|
|
description = 'Builds the sourcecode'
|
|
|
|
classpath = sourceSets.builder.runtimeClasspath
|
|
|
|
main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
|
|
|
|
}
|
|
|
|
|
2021-12-27 20:28:45 +01:00
|
|
|
task generateGithubSource(type: JavaExec) {
|
|
|
|
group = 'internal'
|
|
|
|
description = 'Builds the sourcecode for Github Actions'
|
|
|
|
classpath = sourceSets.builder.runtimeClasspath
|
|
|
|
main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
|
2022-06-14 08:55:40 +02:00
|
|
|
args = ['silent']
|
2021-12-27 20:28:45 +01:00
|
|
|
}
|
|
|
|
|
2021-06-23 19:58:31 +02:00
|
|
|
task forceGenerateSource(type: JavaExec) {
|
|
|
|
group = 'internal'
|
|
|
|
description = 'Builds the sourcecode forceful'
|
|
|
|
classpath = sourceSets.builder.runtimeClasspath
|
|
|
|
main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
|
2022-06-14 08:55:40 +02:00
|
|
|
args = ['force']
|
|
|
|
}
|
|
|
|
|
|
|
|
task generateTestSource(type: JavaExec) {
|
|
|
|
group = 'internal'
|
|
|
|
description = 'Builds the sourcecode for the Tests'
|
|
|
|
classpath = sourceSets.builder.runtimeClasspath
|
|
|
|
main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
|
2022-06-14 09:03:20 +02:00
|
|
|
args = ['tests', 'silent']
|
2021-06-23 19:58:31 +02:00
|
|
|
}
|
|
|
|
|
2023-06-15 17:12:11 +02:00
|
|
|
task forceGenerateTestSource(type: JavaExec) {
|
|
|
|
group = 'internal'
|
|
|
|
description = 'Builds the sourcecode for the Tests'
|
|
|
|
classpath = sourceSets.builder.runtimeClasspath
|
|
|
|
main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
|
|
|
|
args = ['tests', 'silent', 'force']
|
|
|
|
}
|
|
|
|
|
2022-12-19 16:03:43 +01:00
|
|
|
task generateLimitSource(type: JavaExec) {
|
|
|
|
group = 'internal'
|
|
|
|
description = 'Builds the Sourcecode with the ModuleSettings.json applied'
|
|
|
|
classpath = sourceSets.builder.runtimeClasspath
|
|
|
|
main = 'speiger.src.builder.PrimitiveCollectionsBuilder'
|
|
|
|
args = ['silent', 'load']
|
|
|
|
}
|
|
|
|
|
2021-01-29 11:41:48 +01:00
|
|
|
task javadocJar(type: Jar) {
|
|
|
|
from javadoc
|
|
|
|
classifier = 'javadoc'
|
|
|
|
}
|
|
|
|
|
|
|
|
task srcJar(type: Jar) {
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
classifier = 'sources'
|
|
|
|
}
|
|
|
|
|
2022-04-19 16:58:22 +02:00
|
|
|
compileJava.dependsOn generateGithubSource
|
|
|
|
|
2021-01-29 11:41:48 +01:00
|
|
|
javadoc.failOnError = false
|
2021-04-25 21:37:22 +02:00
|
|
|
javadoc.options.memberLevel = JavadocMemberLevel.PUBLIC
|
2021-04-22 23:02:04 +02:00
|
|
|
javadoc.options.quiet()
|
2021-01-29 11:41:48 +01:00
|
|
|
|
|
|
|
artifacts {
|
2021-04-25 03:45:57 +02:00
|
|
|
archives javadocJar
|
2021-01-29 11:41:48 +01:00
|
|
|
archives srcJar
|
|
|
|
}
|
|
|
|
|
2022-06-14 08:55:40 +02:00
|
|
|
task testBooleans(type: Test) {
|
|
|
|
group 'tests'
|
|
|
|
description 'Tests all Boolean Collections'
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
includeTestsMatching "speiger.src.tests.booleans.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task testBytes(type: Test) {
|
|
|
|
group 'tests'
|
|
|
|
description 'Tests all Byte Collections'
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
includeTestsMatching "speiger.src.tests.bytes.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
|
|
|
maxParallelForks = testThreads as Integer
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task testShorts(type: Test) {
|
|
|
|
group 'tests'
|
|
|
|
description 'Tests all Short Collections'
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
includeTestsMatching "speiger.src.tests.shorts.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
|
|
|
maxParallelForks = testThreads as Integer
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task testChars(type: Test) {
|
|
|
|
group 'tests'
|
|
|
|
description 'Tests all Character Collections'
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
includeTestsMatching "speiger.src.tests.chars.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
|
|
|
maxParallelForks = testThreads as Integer
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task testInts(type: Test) {
|
|
|
|
group 'tests'
|
|
|
|
description 'Tests all Int Collections'
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
includeTestsMatching "speiger.src.tests.ints.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
|
|
|
maxParallelForks = testThreads as Integer
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task testLongs(type: Test) {
|
|
|
|
group 'tests'
|
|
|
|
description 'Tests all Long Collections'
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
includeTestsMatching "speiger.src.tests.longs.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
|
|
|
maxParallelForks = testThreads as Integer
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task testFloats(type: Test) {
|
|
|
|
group 'tests'
|
|
|
|
description 'Tests all Float Collections'
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
includeTestsMatching "speiger.src.tests.floats.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
|
|
|
maxParallelForks = testThreads as Integer
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task testDoubles(type: Test) {
|
|
|
|
group 'tests'
|
|
|
|
description 'Tests all Double Collections'
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
includeTestsMatching "speiger.src.tests.doubles.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
|
|
|
maxParallelForks = testThreads as Integer
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task testObjects(type: Test) {
|
|
|
|
group 'tests'
|
|
|
|
description 'Tests all Object Collections'
|
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
includeTestsMatching "speiger.src.tests.objects.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
|
|
|
maxParallelForks = testThreads as Integer
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if(System.getProperty("full_test_suite", "false").toBoolean()) {
|
|
|
|
test.dependsOn testBooleans
|
|
|
|
test.dependsOn testBytes
|
|
|
|
test.dependsOn testShorts
|
|
|
|
test.dependsOn testChars
|
|
|
|
test.dependsOn testInts
|
|
|
|
test.dependsOn testLongs
|
|
|
|
test.dependsOn testFloats
|
|
|
|
test.dependsOn testDoubles
|
|
|
|
test.dependsOn testObjects
|
|
|
|
}
|
|
|
|
|
2021-01-20 04:29:08 +01:00
|
|
|
test {
|
2022-06-14 08:55:40 +02:00
|
|
|
filter {
|
|
|
|
excludeTestsMatching "speiger.src.testers.**.*"
|
|
|
|
excludeTestsMatching "speiger.src.tests.**.*"
|
|
|
|
excludeTestsMatching "tests.**.*"
|
|
|
|
}
|
|
|
|
useJUnit()
|
|
|
|
ignoreFailures = true
|
2023-06-15 17:12:11 +02:00
|
|
|
maxHeapSize = maxMemory
|
2022-06-14 08:55:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
jacocoTestReport {
|
|
|
|
executionData fileTree(project.buildDir.absolutePath).include("jacoco/*.exec")
|
|
|
|
reports {
|
|
|
|
xml.enabled true
|
|
|
|
html.enabled = true
|
|
|
|
csv.enabled true
|
|
|
|
}
|
2021-06-22 15:15:10 +02:00
|
|
|
}
|
|
|
|
|
2022-04-07 16:00:58 +02:00
|
|
|
publishing {
|
2021-12-27 20:04:50 +01:00
|
|
|
Properties props = new Properties()
|
2022-04-07 16:00:58 +02:00
|
|
|
if(file("$buildDir/credentials.properties").exists()) {
|
2021-12-27 20:04:50 +01:00
|
|
|
props.load(new FileInputStream("$buildDir/credentials.properties"))
|
|
|
|
}
|
2022-04-07 16:00:58 +02:00
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
pom {
|
|
|
|
name = 'Primitive Collections'
|
|
|
|
description = 'A Primitive Collection library that reduces memory usage and improves performance'
|
|
|
|
url = 'https://github.com/Speiger/Primitive-Collections'
|
|
|
|
version = project.version
|
|
|
|
artifactId = project.archivesBaseName.replace(" ", "-")
|
|
|
|
groupId = 'de.speiger'
|
|
|
|
from components.java
|
|
|
|
artifact tasks.srcJar
|
|
|
|
artifact tasks.javadocJar
|
2021-06-22 15:15:10 +02:00
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name = 'The Apache License, Version 2.0'
|
|
|
|
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id = 'speiger'
|
|
|
|
name = 'Speiger'
|
|
|
|
}
|
|
|
|
}
|
2022-04-07 16:00:58 +02:00
|
|
|
scm {
|
|
|
|
url = 'https://github.com/Speiger/Primitive-Collections'
|
|
|
|
}
|
|
|
|
issueManagement {
|
|
|
|
system = 'github'
|
|
|
|
url = 'https://github.com/Speiger/Primitive-Collections/issues'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
url version.endsWith('SNAPSHOT') ? "https://maven.speiger.com/repository/debug" : "https://maven.speiger.com/repository/main"
|
|
|
|
credentials(PasswordCredentials) {
|
|
|
|
username props.mavenUser
|
|
|
|
password props.mavenPassword
|
2021-06-22 15:15:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-01-20 04:29:08 +01:00
|
|
|
}
|