Skip to content

Commit

Permalink
Merge branch 'sdk_upgrade' into readable
Browse files Browse the repository at this point in the history
  • Loading branch information
hufman committed Mar 15, 2024
2 parents 8ebc5d4 + 4894563 commit d1eba4a
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 162 deletions.
60 changes: 28 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,28 @@ import de.undercouch.gradle.tasks.download.Download
import de.undercouch.gradle.tasks.download.Verify

buildscript {
ext.kotlin_version = '1.4.21'
ext.kotlin_version = '1.9.0'
repositories {
google()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
//classpath group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'
//classpath group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.2.6'
}
}

plugins {
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'com.github.kt3k.coveralls' version '2.12.2'
id 'de.undercouch.download' version "5.6.0"
}
apply from: 'buildtools/ColoredOutput.gradle'
apply from: 'buildtools/jacoco.gradle'
apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'

if (!project.getPlugins().hasPlugin("de.undercouch.download")) {
apply plugin: "de.undercouch.download"
}

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
repositories {
mavenCentral()
}

dependencies {
Expand All @@ -53,29 +41,32 @@ sourceCompatibility = "1.8"
targetCompatibility = "1.8"

def isRunningOnJitpack = System.getenv("JITPACK") == "true"
task downloadEtchCompiler(type: Download) {
tasks.register('downloadEtchCompiler', Download) {
if (isRunningOnJitpack)
// can't connect to archive.apache.org
// https://github.com/jitpack/jitpack.io/issues/4995
// can't connect to archive.apache.org
// https://github.com/jitpack/jitpack.io/issues/4995
src 'https://bimmergestalt.s3.amazonaws.com/aaidrive/external/apache-etch-1.4.0-windows-x86-bin.zip'
else
src 'https://archive.apache.org/dist/etch/1.4.0/apache-etch-1.4.0-windows-x86-bin.zip'
dest file("${buildDir}/etch/apache-etch-1.4.0-windows-x86-bin.zip")
overwrite false
outputs.file "${buildDir}/etch/apache-etch-1.4.0-windows-x86-bin.zip"
}
task verifyEtchCompiler(type: Verify, dependsOn: downloadEtchCompiler) {
tasks.register('verifyEtchCompiler', Verify) {
dependsOn downloadEtchCompiler
src file("${buildDir}/etch/apache-etch-1.4.0-windows-x86-bin.zip")
algorithm "SHA-512"
checksum "915128A2E6E6FA83F4A576EBAC4DA5A250EC6F3BEB11C76404664B5067CFD94703531219" +
"6CAB6BB6EF96EEB765E39A87E11E774A59257E7932F2D3761CAE0354"
"6CAB6BB6EF96EEB765E39A87E11E774A59257E7932F2D3761CAE0354"
}
task extractEtchCompiler(type: Copy, dependsOn: verifyEtchCompiler) {
tasks.register('extractEtchCompiler', Copy) {
dependsOn verifyEtchCompiler
from zipTree(file("${buildDir}/etch/apache-etch-1.4.0-windows-x86-bin.zip"))
into "${buildDir}/etch"
outputs.dir "${buildDir}/etch/apache-etch-1.4.0"
}
task compileEtch(type: JavaExec, dependsOn: extractEtchCompiler) {
tasks.register('compileEtch', JavaExec) {
dependsOn extractEtchCompiler
main "org.apache.etch.compiler.EtchMain"
classpath files(
"${buildDir}/etch/apache-etch-1.4.0/lib/apache-etch-compiler-1.4.0.jar",
Expand All @@ -87,34 +78,39 @@ task compileEtch(type: JavaExec, dependsOn: extractEtchCompiler) {
inputs.file("etch/BMWRemoting.etch")
outputs.dir "${buildDir}/generated"
}
task enableEtchRuntime(type: Copy, dependsOn: extractEtchCompiler) {
tasks.register('enableEtchRuntime', Copy) {
dependsOn extractEtchCompiler
from "${buildDir}/etch/apache-etch-1.4.0/binding-java/lib"
include '*.jar'
into file("libs/")
}
task extractEtchRuntime(type: Copy, dependsOn: enableEtchRuntime) {
tasks.register('extractEtchRuntime', Copy) {
dependsOn enableEtchRuntime
from zipTree(file("libs/apache-etch-java-runtime-1.4.0.jar"))
include '**/*.class'
includeEmptyDirs false
into "${buildDir}/classes/java/main"
outputs.dir "${buildDir}/classes/java/main/org/apache/etch"
}

compileJava.dependsOn extractEtchRuntime
compileJava.mustRunAfter extractEtchRuntime
compileJava.dependsOn compileEtch
compileJava.dependsOn extractEtchRuntime
compileJava.mustRunAfter compileEtch
compileJava.mustRunAfter extractEtchRuntime
compileKotlin.dependsOn compileEtch
compileJava.mustRunAfter enableEtchRuntime
compileKotlin.dependsOn extractEtchRuntime
compileKotlin.mustRunAfter compileEtch
compileKotlin.mustRunAfter extractEtchRuntime
compileKotlin.dependsOn compileEtch
compileKotlin.dependsOn enableEtchRuntime
compileKotlin.mustRunAfter compileEtch
compileKotlin.mustRunAfter enableEtchRuntime

// https://youtrack.jetbrains.com/issue/IDEA-119280
task copyTestResources(type: Copy) {
tasks.register('copyTestResources', Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
task copyTestResourcesOut(type: Copy) {
tasks.register('copyTestResourcesOut', Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/../out/test/classes"
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Dec 17 22:06:03 PST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
Loading

0 comments on commit d1eba4a

Please sign in to comment.