111 lines
2.6 KiB
Groovy
111 lines
2.6 KiB
Groovy
|
|
buildscript {
|
|
repositories {
|
|
maven {
|
|
url "https://plugins.gradle.org/m2/"
|
|
}
|
|
}
|
|
dependencies {
|
|
// run with Java 11 and ./gradlew --no-daemon clean jmh
|
|
classpath "me.champeau.gradle:jmh-gradle-plugin:0.5.3"
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
// usage: gradle dependencyUpdates -Drevision=release
|
|
id "com.github.ben-manes.versions" version "0.45.0"
|
|
}
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'eclipse'
|
|
|
|
|
|
ext {
|
|
javaVersion=17
|
|
version_junit = '5.9.2'
|
|
version_junit_platform = '1.9.2'
|
|
}
|
|
|
|
|
|
// java compatibility version
|
|
sourceCompatibility = javaVersion
|
|
|
|
/*
|
|
* The shared configuration for all sub-projects:
|
|
*/
|
|
subprojects {
|
|
apply plugin: 'java-library'
|
|
apply plugin: 'eclipse'
|
|
//apply plugin: 'maven'
|
|
apply plugin: 'maven-publish'
|
|
apply plugin: 'me.champeau.gradle.jmh'
|
|
|
|
// java compatibility version
|
|
sourceCompatibility = 17
|
|
|
|
configurations {
|
|
tests
|
|
}
|
|
|
|
// the repositories for external depenencies
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
/**
|
|
* Publish the to a local repository.
|
|
* Use 'gradlew publishToMavenLocal' to publish to the local maven repo.
|
|
* If the property 'mavenDeployRepo' is set in gradle.properties, then you can use
|
|
* 'gradlew publishMavenJavaPublicationToMyRepoRepository' to publish to that repository.
|
|
*/
|
|
publishing {
|
|
if (project.hasProperty('mavenDeployRepo')){
|
|
repositories {
|
|
maven {
|
|
name = "MyRepo" // optional target repository name
|
|
url = "${mavenDeployRepo}"
|
|
}
|
|
}
|
|
}
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
from components.java
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
java {
|
|
withSourcesJar()
|
|
|
|
// Gradle 7.0 put half the dependencies on the module path. But without a module-info.java file
|
|
// JUnit didn't want to run because of a class not found error. By disabling modules we ensure
|
|
// all jars are put on the classpath.
|
|
modularity.inferModulePath.set(false)
|
|
}
|
|
|
|
|
|
// dependencies that all sub-projects have
|
|
dependencies {
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:${version_junit}"
|
|
testImplementation "org.junit.jupiter:junit-jupiter-params:${version_junit}" // for @ParameterizedTest
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${version_junit}"
|
|
testRuntimeOnly "org.junit.platform:junit-platform-launcher:${version_junit_platform}" // needed by eclipse
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
jmh {
|
|
//jvmArgsAppend = ""
|
|
resultFormat = "JSON"
|
|
include = ['.*BenchmarkMultiwayMerge.*'] // include pattern (regular expression) for benchmarks to be executed
|
|
//exclude = ['some regular expression'] // exclude pattern (regular expression) for benchmarks to be executed
|
|
}
|
|
}
|
|
|
|
wrapper {
|
|
gradleVersion = '7.5.1'
|
|
}
|