diff --git a/build.gradle b/build.gradle index e38b2bd..8537b1a 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,6 @@ buildscript { ext { kotlinVersion = '1.3.71' slf4jVersion = '1.7.26' - } repositories { @@ -11,10 +10,9 @@ buildscript { dependencies { classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}") - classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.18" - classpath 'com.github.ben-manes:gradle-versions-plugin:0.21.0' // gradle dependencyUpdates -Drevision=release - classpath "de.thetaphi:forbiddenapis:2.6" - classpath 'com.diffplug.spotless:spotless-plugin-gradle:3.23.1' + classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.10.1" + classpath 'com.github.ben-manes:gradle-versions-plugin:0.28.0' // gradle dependencyUpdates -Drevision=release + classpath 'com.diffplug.spotless:spotless-plugin-gradle:3.28.1' } } @@ -23,17 +21,8 @@ apply plugin: 'kotlin' apply plugin: 'org.jetbrains.dokka' apply plugin: 'project-report' // useful for gradle htmlDependencyReport apply plugin: 'com.diffplug.gradle.spotless' -apply plugin: "de.thetaphi.forbiddenapis" apply plugin: 'com.github.ben-manes.versions' -forbiddenApis { - // https://github.com/policeman-tools/forbidden-apis/wiki/GradleUsage - bundledSignatures = ["jdk-unsafe-9", "jdk-deprecated-9", "jdk-non-portable", "jdk-internal-9"] - // take out "jdk-system-out" - signaturesFiles = files("forbidden_signatures.txt") - ignoreFailures = false -} - // this intentionally breaks the build if you mess up the formatting; pro tip: use Save Actions plugin in intellij and auto format and organize imports on save spotless { java { @@ -56,10 +45,12 @@ afterEvaluate { } dokka { + configuration { + jdkVersion = 8 + includes = ['src/main/kotlin/io/inbot/eskotlinwrapper/module.md'] + } outputFormat = 'gfm' - jdkVersion = 8 outputDirectory = 'docs' - includes = ['src/main/kotlin/io/inbot/eskotlinwrapper/module.md'] } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { @@ -126,7 +117,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}" testImplementation 'io.kotest:kotest-runner-junit5:4.0.2' // for kotest framework testImplementation 'io.kotest:kotest-assertions-core-jvm:4.0.2' // for kotest core jvm assertions - testCompile 'org.testng:testng:6.13.1' + testCompile 'org.testng:testng:7.2.0' testCompile 'org.hamcrest:hamcrest-all:1.3' // kotlintest runner needs this diff --git a/src/test/java/com/jillesvangurp/geo/GeoGeometryTest.java b/src/test/java/com/jillesvangurp/geo/GeoGeometryTest.java index 6692ff9..7e1e901 100644 --- a/src/test/java/com/jillesvangurp/geo/GeoGeometryTest.java +++ b/src/test/java/com/jillesvangurp/geo/GeoGeometryTest.java @@ -451,14 +451,6 @@ public void shouldCalculateAreaOfMultiPolygon() { assertThat(area(multiPolygon), is(2*area(polygon))); } - public void shouldSimplifyLineOnlyOnce() { - double[][] line=new double[][] {newyork,moritzPlatz,senefelderPlatz,naturkundeMuseum, buenosaires}; - double[][] simplified = GeoGeometry.simplifyLine(line, 10000); - double[][] superSimplified = GeoGeometry.simplifyLine(simplified,10000); - assertThat(simplified.length, lessThan(line.length)); - assertThat(simplified.length, is(superSimplified.length)); - } - @DataProvider public Object[][] straightLines() { return new Object[][] { diff --git a/src/test/kotlin/com/jillesvangurp/geogeometry/GeoGeometryTest.kt b/src/test/kotlin/com/jillesvangurp/geogeometry/GeoGeometryTest.kt index 884aafe..1e5c0df 100644 --- a/src/test/kotlin/com/jillesvangurp/geogeometry/GeoGeometryTest.kt +++ b/src/test/kotlin/com/jillesvangurp/geogeometry/GeoGeometryTest.kt @@ -1,8 +1,12 @@ package com.jillesvangurp.geogeometry import com.jillesvangurp.geo.GeoGeometry +import com.jillesvangurp.geo.GeoGeometry.Companion.simplifyLine import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.shouldBe +import org.hamcrest.CoreMatchers +import org.hamcrest.MatcherAssert +import org.hamcrest.Matchers class GeoGeometryTest : StringSpec() { init { @@ -19,5 +23,6 @@ class GeoGeometryTest : StringSpec() { GeoGeometry.linesCross(l1p1, l1p2, l2p1, l2p2) shouldBe false GeoGeometry.linesCross(l2p1, l2p2, l1p1, l1p2) shouldBe false } + } }