diff --git a/Android/build.gradle b/Android/build.gradle index 0cf39cba..172b1ca2 100644 --- a/Android/build.gradle +++ b/Android/build.gradle @@ -1,15 +1,8 @@ -//name = 'Better London Travel Android App' -apply plugin: 'net.twisterrob.gradle.plugin.android-app' -apply plugin: 'com.android.application' - -repositories { - maven { - name = "jitpack.io" - url = uri("https://jitpack.io/") - content { - includeModule("com.github.martin-stone", "hsv-alpha-color-picker-android") - } - } +//name = "Better London Travel Android App" +plugins { + id("net.twisterrob.blt.convention") + id("net.twisterrob.gradle.plugin.android-app") + id("com.android.application") } dependencies { @@ -23,15 +16,15 @@ dependencies { implementation("net.twisterrob.lib:twister-lib-android-color_picker") implementation("net.twisterrob.lib:twister-lib-android-settings") - implementation(project(':Shared')) { - exclude module: 'android-polyfill' + implementation(projects.shared) { + exclude module: "android-polyfill" } - implementation("com.google.android.gms:play-services-maps:${VERSION_MAPS}") - implementation("com.google.android.gms:play-services-places:${VERSION_MAPS}") - implementation("com.google.code.findbugs:jsr305:${VERSION_JSR305}") - implementation("com.github.bumptech.glide:glide:${VERSION_GLIDE}") + implementation(libs.gms.maps) + implementation(libs.gms.places) + implementation(libs.jsr305) + implementation(libs.glide) - apply from: "${rootDir}/gradle/testCompile.gradle", to: project + testImplementation(projects.shared.testHelpers) } android { @@ -51,7 +44,7 @@ android { } debug { // twister-lib-android only has release build type - matchingFallbacks = ['release'] + matchingFallbacks = [ "release" ] } } buildFeatures { @@ -62,30 +55,32 @@ android { checkDependencies = true abortOnError = false lintConfig = file("lint.xml") - baseline file("lint-baseline.xml") + baseline = file("lint-baseline.xml") } flavorDimensions += "app-build" productFlavors { full { // default - applicationId = 'net.twisterrob.blt' - dimension "app-build" + applicationId = "net.twisterrob.blt" + dimension("app-build") } range { - applicationId = 'net.twisterrob.blt.range' - dimension "app-build" + applicationId = "net.twisterrob.blt.range" + dimension("app-build") } } } abstract class GenerateDatabase extends Copy { + @Internal("An intermediate property to satisfy AGP, tracked in destination.") abstract DirectoryProperty getOutput() } + def generateDataBase = tasks.register("generateDataBase", GenerateDatabase.class) { dependsOn(":Data:runNetwork", ":Data:runPostCode") - from(new File(project(':Data').projectDir, 'output')) { - include '*.data.*.sql' + from(new File(projects.data.dependencyProject.projectDir, "output")) { + include("*.data.*.sql") } into(output) } diff --git a/AppEngine/build.gradle b/AppEngine/build.gradle index 4d1887d4..63b29e99 100644 --- a/AppEngine/build.gradle +++ b/AppEngine/build.gradle @@ -1,43 +1,36 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform -apply plugin: 'java' -apply plugin: 'io.micronaut.minimal.application' -apply plugin: 'com.google.cloud.tools.appengine-appyaml' -apply plugin: 'idea' +plugins { + id("net.twisterrob.blt.convention") + id("org.gradle.java") + id("io.micronaut.minimal.application") + id("com.google.cloud.tools.appengine-appyaml") + id("org.gradle.idea") +} java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = libs.versions.java.appengine.get() + targetCompatibility = libs.versions.java.appengine.get() } dependencies { - implementation("com.google.appengine:appengine-api-1.0-sdk:2.0.12") - implementation(platform("com.google.cloud:libraries-bom:${VERSION_GCLOUD}")) - implementation("com.google.cloud:google-cloud-datastore") - - runtimeOnly("org.yaml:snakeyaml") - runtimeOnly("io.micronaut.serde:micronaut-serde-jackson") - implementation("io.micronaut.views:micronaut-views-handlebars") + implementation(libs.appengine.api) + implementation(platform(libs.google.cloud)) + implementation(libs.google.cloud.datastore) - implementation project(':Shared') + runtimeOnly(libs.snakeyaml) + runtimeOnly(libs.micronaut.jackson) + implementation(libs.micronaut.handlebars) - implementation("org.slf4j:slf4j-api:${VERSION_SLF4J}") - runtimeOnly("org.apache.logging.log4j:log4j-slf4j2-impl:${VERSION_LOG4J}") - // for org.apache.tools.ant.filters.StringInputStream - implementation("ant:ant:1.6.5") + implementation(projects.shared) + implementation(projects.shared.diff) - apply from: "${rootDir}/gradle/testCompile.gradle", to: project - testImplementation("io.micronaut:micronaut-http-client") - testImplementation("com.github.jtidy:jtidy:${VERSION_JTIDY}") -} + implementation(libs.slf4j.api) + runtimeOnly(libs.log4j.slf4j2) -sourceSets { - main { - java.srcDir 'src/main/diff' - } - test { - java.srcDir 'src/test/diff' - } + testImplementation(projects.shared.testHelpers) + testImplementation(libs.micronaut.httpClient) + testImplementation(libs.jtidy) } //noinspection UnnecessaryQualifiedReference @@ -59,18 +52,18 @@ appengine { com.google.cloud.tools.gradle.appengine.appyaml.AppEngineAppYamlExte } tools { System.getenv("GCLOUD_HOME")?.tap { cloudSdkHome = it } - cloudSdkVersion = VERSION_GCLOUD_SDK as String + cloudSdkVersion = libs.versions.google.cloud.sdk.get() // https://cloud.google.com/sdk/gcloud/reference#--verbosity verbosity = "info" } } application { - mainClass.set("net.twisterrob.blt.gapp.Application") + mainClass = "net.twisterrob.blt.gapp.Application" } micronaut { - version = VERSION_MICRONAUT as String + version = libs.versions.micronaut.asProvider().get() runtime("jetty") testRuntime("junit4") processing { diff --git a/AppEngine/src/main/java/net/twisterrob/blt/gapp/LineStatusHistoryServlet.java b/AppEngine/src/main/java/net/twisterrob/blt/gapp/LineStatusHistoryServlet.java index 0a6b196d..caafe976 100644 --- a/AppEngine/src/main/java/net/twisterrob/blt/gapp/LineStatusHistoryServlet.java +++ b/AppEngine/src/main/java/net/twisterrob/blt/gapp/LineStatusHistoryServlet.java @@ -11,8 +11,6 @@ import io.micronaut.views.View; import jakarta.servlet.http.*; -import org.apache.tools.ant.filters.StringInputStream; - import com.google.cloud.datastore.*; import com.google.cloud.datastore.StructuredQuery.OrderBy; @@ -95,7 +93,7 @@ private static Result toResult(BaseEntity entry) { if (content != null) { try { Feed feed = Feed.valueOf(entry.getKey().getKind()); - InputStream stream = new StringInputStream(content, ENCODING); + InputStream stream = new ByteArrayInputStream(content.getBytes(ENCODING)); @SuppressWarnings({"RedundantTypeArguments", "RedundantSuppression"}) // False positive. LineStatusFeed feedContents = feed.getHandler().parse(stream); result = new Result(date, feedContents); diff --git a/AppEngine/src/main/java/net/twisterrob/blt/gapp/viewmodel/ResultChange.java b/AppEngine/src/main/java/net/twisterrob/blt/gapp/viewmodel/ResultChange.java index 5b9e062e..37dff3e0 100644 --- a/AppEngine/src/main/java/net/twisterrob/blt/gapp/viewmodel/ResultChange.java +++ b/AppEngine/src/main/java/net/twisterrob/blt/gapp/viewmodel/ResultChange.java @@ -2,9 +2,7 @@ import java.util.*; -import name.fraser.neil.plaintext.diff_match_patch; -import name.fraser.neil.plaintext.diff_match_patch.Diff; - +import net.twisterrob.blt.diff.HtmlDiff; import net.twisterrob.blt.io.feeds.trackernet.model.LineStatus; import net.twisterrob.blt.model.Line; @@ -107,10 +105,7 @@ protected void diffDesc(Line line, LineStatus oldStatus, LineStatus newStatus) { } private static String diffDesc(String oldDesc, String newDesc) { - diff_match_patch differ = new diff_match_patch(); - LinkedList diff = differ.diff_main(oldDesc, newDesc); - differ.diff_cleanupSemantic(diff); - return differ.diff_prettyHtml(diff); + return new HtmlDiff().diff(oldDesc, newDesc); } protected void diffError() { diff --git a/Data/build.gradle b/Data/build.gradle index 66bccff2..c21a2745 100644 --- a/Data/build.gradle +++ b/Data/build.gradle @@ -1,29 +1,37 @@ -// name = 'twister-travel-data' -version = '0.0.1-SNAPSHOT' +plugins { + id("net.twisterrob.blt.convention") + id("org.gradle.java-library") + id("net.twisterrob.gradle.plugin.java") + id("org.gretty") + id("org.gradle.idea") +} + +java { + sourceCompatibility = libs.versions.java.asProvider().get() + targetCompatibility = libs.versions.java.asProvider().get() +} + +// name = "twister-travel-data" +version = "0.0.1-SNAPSHOT" // Better London Travel Data Generation // Standalone project to handle large feeds -apply plugin: 'java-library' -apply plugin: 'net.twisterrob.gradle.plugin.java' - dependencies { - //configurations.implementation.resolutionStrategy.cacheChangingModulesFor 0, 'seconds' // -SNAPSHOT - api project(':Shared') - implementation("com.google.code.findbugs:jsr305:${VERSION_JSR305}") - implementation("org.slf4j:slf4j-api:${VERSION_SLF4J}") - runtimeOnly "org.slf4j:slf4j-simple:${VERSION_SLF4J}" - implementation 'org.xerial:sqlite-jdbc:3.7.15-M1' + api(projects.shared) + implementation(libs.jsr305) + implementation(libs.slf4j.api) + implementation(libs.slf4j.simple) + implementation(libs.sqlite.jdbc) - apply from: "${rootDir}/gradle/testCompile.gradle", to: project + testImplementation(projects.shared.testHelpers) } -apply plugin: 'org.gretty' // TODO logging doesn't work with org.eclipse nor org.mortbay package names // -Dorg.mortbay.log.class=org.eclipse.jetty.util.log.StrErrLog changes the logger, but no output // --debug logs, but too much and not configurable gretty { // org.akhikhl.gretty.GrettyExtension //daemon = true - extraResourceBase(file('src/data')) + extraResourceBase(file("src/data")) // + Magic @Delegate org.akhikhl.gretty.ServerConfig through GrettyExtension implements GrettyConfig httpPort = 8081 @@ -33,44 +41,46 @@ gretty { // org.akhikhl.gretty.GrettyExtension // + Magic @Delegate org.akhikhl.gretty.WebAppConfig through GrettyExtension implements GrettyConfig } -apply plugin: 'idea' idea { module { - excludeDirs = [ file('output'), file('src/data') ] + excludeDirs = [ + file("output"), + file("src/data"), + ] } } -task runNetwork(type: JavaExec) { - def inputDir = '../temp/feed15/LULDLRRiverTramCable' - def outputDir = 'output'; - inputs.dir inputDir - inputs.dir 'src/data/PredictionSummary' - outputs.dir outputDir +tasks.register("runNetwork", JavaExec.class) { + def inputDir = "../temp/feed15/LULDLRRiverTramCable" + def outputDir = "output" + inputs.dir(inputDir).withPathSensitivity(PathSensitivity.RELATIVE) + inputs.dir("src/data/PredictionSummary") + outputs.dir(outputDir) group = ApplicationPlugin.APPLICATION_GROUP classpath = sourceSets.main.runtimeClasspath - mainClass = 'net.twisterrob.blt.data.apps.TravelNetworkParser' + mainClass = "net.twisterrob.blt.data.apps.TravelNetworkParser" args = [ inputDir, outputDir ] enableAssertions = true } -task runPostCode(type: JavaExec) { - def inputDir = '../temp/feed15/LULDLRRiverTramCable' - def outputFile = 'output/LondonTravel.data.AreaHull.sql'; - inputs.dir inputDir - outputs.file outputFile +tasks.register("runPostCode", JavaExec.class) { + def inputDir = "../temp/feed15/LULDLRRiverTramCable" + def outputFile = "output/LondonTravel.data.AreaHull.sql" + inputs.dir(inputDir).withPathSensitivity(PathSensitivity.RELATIVE) + outputs.file(outputFile) group = ApplicationPlugin.APPLICATION_GROUP classpath = sourceSets.main.runtimeClasspath - mainClass = 'net.twisterrob.blt.data.apps.PostCodeAreas' + mainClass = "net.twisterrob.blt.data.apps.PostCodeAreas" enableAssertions = true } -task runDisplay(type: JavaExec) { +tasks.register("runDisplay", JavaExec.class) { group = ApplicationPlugin.APPLICATION_GROUP classpath = sourceSets.main.runtimeClasspath - mainClass = 'net.twisterrob.blt.data.apps.DisplayLine' - args = [ 'DLR' ] - if (project.hasProperty('lines')) { - args = project.property('lines').toString().split(',') as List; + mainClass = "net.twisterrob.blt.data.apps.DisplayLine" + args = [ "DLR" ] + if (project.hasProperty("lines")) { + args = project.property("lines").toString().split(",") as List } enableAssertions = true } diff --git a/Shared/android-polyfill/build.gradle b/Shared/android-polyfill/build.gradle index 3f4e5fd5..9cadc15c 100644 --- a/Shared/android-polyfill/build.gradle +++ b/Shared/android-polyfill/build.gradle @@ -1,10 +1,14 @@ -apply plugin: 'net.twisterrob.gradle.plugin.java' +plugins { + id("net.twisterrob.blt.convention") + id("org.gradle.java") + id("net.twisterrob.gradle.plugin.java") +} java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = libs.versions.java.asProvider().get() + targetCompatibility = libs.versions.java.asProvider().get() } dependencies { - implementation 'net.sf.kxml:kxml2:2.3.0' + implementation(libs.kxml2) } diff --git a/Shared/build.gradle b/Shared/build.gradle index 5c867a13..57c99efe 100644 --- a/Shared/build.gradle +++ b/Shared/build.gradle @@ -1,23 +1,26 @@ -apply plugin: 'java-library' -apply plugin: 'net.twisterrob.gradle.plugin.java' +plugins { + id("net.twisterrob.blt.convention") + id("org.gradle.java-library") + id("net.twisterrob.gradle.plugin.java") +} java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = libs.versions.java.asProvider().get() + targetCompatibility = libs.versions.java.asProvider().get() } // Better London Travel Shared // Shared model and surrounding classes -//name = 'twister-travel-shared' -version = '0.0.1-SNAPSHOT' +//name = "twister-travel-shared" +version = "0.0.1-SNAPSHOT" dependencies { - api('net.twisterrob.lib:twister-lib-general') - api('net.twisterrob.lib:twister-lib-core') + api("net.twisterrob.lib:twister-lib-general") + api("net.twisterrob.lib:twister-lib-core") - implementation("com.google.code.findbugs:jsr305:${VERSION_JSR305}") - implementation("org.slf4j:slf4j-api:${VERSION_SLF4J}") - implementation project(':Shared:android-polyfill') - implementation('net.twisterrob.lib:twister-lib-java_desktop') + implementation(libs.jsr305) + implementation(libs.slf4j.api) + implementation(projects.shared.androidPolyfill) + implementation("net.twisterrob.lib:twister-lib-java_desktop") - apply from: "${rootDir}/gradle/testCompile.gradle", to: project + testImplementation(projects.shared.testHelpers) } diff --git a/Shared/diff/build.gradle b/Shared/diff/build.gradle new file mode 100644 index 00000000..83f046b2 --- /dev/null +++ b/Shared/diff/build.gradle @@ -0,0 +1,10 @@ +plugins { + id("net.twisterrob.blt.convention") + id("org.gradle.java-library") + id("net.twisterrob.gradle.plugin.java") +} + +java { + sourceCompatibility = libs.versions.java.asProvider().get() + targetCompatibility = libs.versions.java.asProvider().get() +} diff --git a/AppEngine/src/main/diff/name/fraser/neil/plaintext/diff_match_patch.java b/Shared/diff/src/main/java/name/fraser/neil/plaintext/diff_match_patch.java similarity index 99% rename from AppEngine/src/main/diff/name/fraser/neil/plaintext/diff_match_patch.java rename to Shared/diff/src/main/java/name/fraser/neil/plaintext/diff_match_patch.java index 620f47a1..54963ed9 100644 --- a/AppEngine/src/main/diff/name/fraser/neil/plaintext/diff_match_patch.java +++ b/Shared/diff/src/main/java/name/fraser/neil/plaintext/diff_match_patch.java @@ -36,6 +36,7 @@ * Class containing the diff, match and patch methods. * Also contains the behaviour settings. */ +// TODO replace with https://github.com/google/diff-match-patch/tree/master/java public class diff_match_patch { // Defaults. diff --git a/Shared/diff/src/main/java/net/twisterrob/blt/diff/HtmlDiff.java b/Shared/diff/src/main/java/net/twisterrob/blt/diff/HtmlDiff.java new file mode 100644 index 00000000..a227f00e --- /dev/null +++ b/Shared/diff/src/main/java/net/twisterrob/blt/diff/HtmlDiff.java @@ -0,0 +1,15 @@ +package net.twisterrob.blt.diff; + +import java.util.LinkedList; + +import name.fraser.neil.plaintext.diff_match_patch; +import name.fraser.neil.plaintext.diff_match_patch.Diff; + +public class HtmlDiff { + public String diff(String oldText, String newText) { + diff_match_patch differ = new diff_match_patch(); + LinkedList diff = differ.diff_main(oldText, newText); + differ.diff_cleanupSemantic(diff); + return differ.diff_prettyHtml(diff); + } +} diff --git a/Shared/test-helpers/build.gradle b/Shared/test-helpers/build.gradle new file mode 100644 index 00000000..d8af37a6 --- /dev/null +++ b/Shared/test-helpers/build.gradle @@ -0,0 +1,23 @@ +plugins { + id("net.twisterrob.blt.convention") + id("org.gradle.java-library") +} + +java { + sourceCompatibility = libs.versions.java.asProvider().get() + targetCompatibility = libs.versions.java.asProvider().get() +} + +dependencies { + api(libs.test.junit4) { + // we don't need this because we use org.hamcrest v2 + exclude module: "hamcrest-core" + } + api(libs.test.hamcrest){ + // this needs to be excluded because otherwise the hamcrest-core exclusion above doesn't work + exclude module: "junit" + } + api(libs.test.mockito) + api(libs.test.gwen) + runtimeOnly(libs.slf4j.simple) +} diff --git a/build.gradle b/build.gradle index f7865335..de50dfa6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,30 +1,14 @@ -allprojects { - //configurations.implementation.resolutionStrategy.cacheChangingModulesFor 0, 'seconds' // -SNAPSHOT - - group = 'net.twisterrob.travel' - - repositories { - google() - mavenCentral() - } - - afterEvaluate { - tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' - options.compilerArgs += [ - "-Werror", - "-Xmaxwarns", "1000", - "-Xmaxerrs", "1000", - "-Xlint:-deprecation", - "-Xlint:unchecked", - ] - } - } +plugins { + id("net.twisterrob.blt.convention") + id("org.gradle.idea") } -apply plugin: 'idea' idea { module { - excludeDirs = [ file(".gradle"), file('.idea'), file('temp') ] + excludeDirs = [ + file(".gradle"), + file(".idea"), + file("temp"), + ] } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 1b063d7f..00639502 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -1,18 +1,11 @@ -repositories { - google() - mavenCentral() - gradlePluginPortal() +plugins { + id("org.gradle.groovy-gradle-plugin") } -def props = new Properties() -props.load(file("../gradle.properties").newInputStream()) - -//configurations.implementation.resolutionStrategy.cacheChangingModulesFor 0, 'seconds' // -SNAPSHOT dependencies { - implementation "net.twisterrob.gradle:twister-convention-plugins:${props.VERSION_TWISTER_GRADLE}" - implementation "com.android.tools.build:gradle:${props.VERSION_AGP}" - // https://github.com/GoogleCloudPlatform/app-gradle-plugin - implementation "com.google.cloud.tools:appengine-gradle-plugin:${props.VERSION_APPENGINE_PLUGIN}" - implementation "io.micronaut.application:io.micronaut.application.gradle.plugin:${props.VERSION_MICRONAUT}" - implementation "org.gretty:gretty:3.0.5" + implementation(libs.plugin.twisterrob) + implementation(libs.plugin.agp) + implementation(libs.plugin.appengine) + implementation(libs.plugin.micronaut) + implementation(libs.plugin.gretty) } diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle index e69de29b..ad30b27a 100644 --- a/buildSrc/settings.gradle +++ b/buildSrc/settings.gradle @@ -0,0 +1,16 @@ +rootProject.name = "net-twisterrob-travel-buildSrc" + +dependencyResolutionManagement { + repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS + repositories { + google() + mavenCentral() + gradlePluginPortal() + } + + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} diff --git a/buildSrc/src/main/groovy/net.twisterrob.blt.convention.gradle b/buildSrc/src/main/groovy/net.twisterrob.blt.convention.gradle new file mode 100644 index 00000000..d96cdc4b --- /dev/null +++ b/buildSrc/src/main/groovy/net.twisterrob.blt.convention.gradle @@ -0,0 +1,12 @@ +group = "net.twisterrob.travel" + +tasks.withType(JavaCompile).configureEach { + options.encoding = "UTF-8" + options.compilerArgs += [ + "-Werror", + "-Xmaxwarns", "1000", + "-Xmaxerrs", "1000", + "-Xlint:-deprecation", + "-Xlint:unchecked", + ] +} diff --git a/gradle.properties b/gradle.properties index 29592d5b..496fb116 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,49 +6,3 @@ org.gradle.warning.mode=fail android.useAndroidX=true android.enableJetifier=true android.nonTransitiveRClass=false - -# -# -# Common -# -VERSION_SLF4J=2.0.9 -VERSION_JSR305=3.0.2 -# -# -# Android -# -VERSION_AGP=8.1.1 -VERSION_TWISTER_GRADLE=0.16 -# -# TODO replace SupportPlaceAutocompleteFragment when updating to AndroidX -# TODO update to 17.0.0 when using AndroidX -VERSION_MAPS=16.1.0 -VERSION_GLIDE=3.8.0 -# -# -# AppEngine -# -# https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/master/CHANGELOG.md -VERSION_APPENGINE_PLUGIN=2.5.0 -# https://cloud.google.com/appengine/docs/standard/java/release-notes -VERSION_APPENGINE=1.9.98 -# Run `gcloud components update` to get the new available version. -# (or `gcloud components update --version ` to revert) -# https://cloud.google.com/sdk/docs/release-notes -VERSION_GCLOUD_SDK=455.0.0 -VERSION_GCLOUD=26.27.0 - -# -VERSION_MICRONAUT=4.2.0 -# https://logging.apache.org/log4j/2.x/release-notes.html -VERSION_LOG4J=2.22.0 -# -# -# Test -# -VERSION_MOCKITO=5.7.0 -VERSION_JUNIT=4.13.2 -# Use this instead of 1.3 -# If `hamcrest-1.3` appears in the dependency list, check if it's excluded from all usages. -VERSION_HAMCREST=2.0.0.0 -VERSION_JTIDY=1.0.5 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..e08700a2 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,77 @@ +[versions] +java = "1.8" +java-android = "17" +java-appengine = "17" + +agp = "8.1.1" +twisterrob = "0.16" +gretty = "3.0.5" + +jsr305 = "3.0.2" +kxml2 = "2.3.0" +sqlite-jdbc = "3.7.15-M1" +glide = "3.8.0" + +slf4j = "2.0.9" +# https://logging.apache.org/log4j/2.x/release-notes.html +log4j ="2.22.0" + +google-cloud = "26.27.0" +# Run `gcloud components update` to get the new available version. +# (or `gcloud components update --version ` to revert) +# https://cloud.google.com/sdk/docs/release-notes +google-cloud-sdk = "455.0.0" +# https://cloud.google.com/appengine/docs/standard/java/release-notes +google-appengine = "2.0.12" +google-appengine-plugin = "2.5.0" +# TODO replace SupportPlaceAutocompleteFragment when updating to AndroidX +# TODO update to 17.0.0 when using AndroidX +google-maps = "16.1.0" +google-datastore = "2.17.5" + +micronaut = "4.2.0" +micronaut-jackson = "2.4.0" +micronaut-handlebars = "5.0.1" +snakeyaml = "2.0" + +junit4 = "4.13.2" +mockito = "5.7.0" +# Use this instead of 1.3 +# If `hamcrest-1.3` appears in the dependency list, check if it's excluded from all usages. +hamcrest = "2.0.0.0" +gwen = "1.0.2" +jtidy = "1.0.5" + +[libraries] +plugin-agp = { module = "com.android.tools.build:gradle", version.ref = "agp" } +# https://github.com/GoogleCloudPlatform/app-gradle-plugin/blob/master/CHANGELOG.md +plugin-appengine = { module = "com.google.cloud.tools:appengine-gradle-plugin", version.ref = "google-appengine-plugin" } +plugin-twisterrob = { module = "net.twisterrob.gradle:twister-convention-plugins", version.ref = "twisterrob" } +plugin-gretty = { module = "org.gretty:gretty", version.ref = "gretty" } + +plugin-micronaut = { module = "io.micronaut.application:io.micronaut.application.gradle.plugin", version.ref = "micronaut" } +micronaut-httpClient = { module = "io.micronaut:micronaut-http-client", version.ref = "micronaut" } +micronaut-jackson = { module = "io.micronaut.serde:micronaut-serde-jackson", version.ref = "micronaut-jackson" } +micronaut-handlebars = { module = "io.micronaut.views:micronaut-views-handlebars", version.ref = "micronaut-handlebars" } +snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "snakeyaml" } + +jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "jsr305" } +kxml2 = { module = "net.sf.kxml:kxml2", version.ref = "kxml2" } +sqlite-jdbc = { module = "org.xerial:sqlite-jdbc", version.ref = "sqlite-jdbc" } +glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" } + +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } +log4j-slf4j2 = { module = "org.apache.logging.log4j:log4j-slf4j2-impl", version.ref = "log4j" } + +google-cloud = { module = "com.google.cloud:libraries-bom", version.ref = "google-cloud" } +google-cloud-datastore = { module = "com.google.cloud:google-cloud-datastore", version.ref = "google-datastore" } +appengine-api = { module = "com.google.appengine:appengine-api-1.0-sdk", version.ref = "google-appengine" } +gms-places = { module = "com.google.android.gms:play-services-places", version.ref = "google-maps" } +gms-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "google-maps" } + +test-junit4 = { module = "junit:junit", version.ref = "junit4" } +test-mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" } +test-hamcrest = { module = "org.hamcrest:hamcrest-junit", version.ref = "hamcrest" } +test-gwen = { module = "com.shazam:gwen", version.ref = "gwen" } +jtidy = { module = "com.github.jtidy:jtidy", version.ref = "jtidy" } diff --git a/gradle/testCompile.gradle b/gradle/testCompile.gradle deleted file mode 100644 index d0a9ae66..00000000 --- a/gradle/testCompile.gradle +++ /dev/null @@ -1,13 +0,0 @@ -dependencies { - testImplementation("junit:junit:${VERSION_JUNIT}") { - // we don't need this because we use org.hamcrest v2 - exclude module: 'hamcrest-core' - } - testImplementation("org.hamcrest:hamcrest-junit:${VERSION_HAMCREST}") { - // this needs to be excluded because otherwise the hamcrest-core exclusion above doesn't work - exclude module: 'junit' - } - testImplementation("org.mockito:mockito-core:${VERSION_MOCKITO}") {} - testImplementation 'com.shazam:gwen:1.0.2' - testRuntimeOnly("org.slf4j:slf4j-simple:${VERSION_SLF4J}") -} diff --git a/libs b/libs index 93d78664..b290da8e 160000 --- a/libs +++ b/libs @@ -1 +1 @@ -Subproject commit 93d78664464c005bd39883d78b24d713fd2454a3 +Subproject commit b290da8e42dc37a3d5bbf1e4f02c14f10615a814 diff --git a/settings.gradle b/settings.gradle index 6a298a98..deb45562 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,35 @@ -rootProject.name = 'Better London Travel' +import static net.twisterrob.gradle.settings.SettingsUtils.enableFeaturePreviewQuietly -include ':Android' -include ':Shared' -include ':AppEngine' -include ':Shared:android-polyfill' -include ':Data' +plugins { + id("net.twisterrob.gradle.plugin.settings") version "0.16" +} + +rootProject.name = "net-twisterrob-blt" + +include(":Android") +include(":AppEngine") +include(":Data") +include(":Shared") +include(":Shared:android-polyfill") +include(":Shared:diff") +include(":Shared:test-helpers") + +enableFeaturePreviewQuietly(settings, "TYPESAFE_PROJECT_ACCESSORS", "Type-safe project accessors") + +dependencyResolutionManagement { + repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS + repositories { + google() + mavenCentral() + maven { + name = "jitpack.io" + url = uri("https://jitpack.io/") + content { + includeModule("com.github.martin-stone", "hsv-alpha-color-picker-android") + } + } + } +} includeBuild("libs") { build -> apply from: new File(build.projectDir, "gradle/settings.substitutions.gradle"), to: build