Skip to content

Commit

Permalink
Split etch runtime to a separate submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
hufman committed Aug 7, 2024
1 parent 214f8bd commit db58d8e
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 21 deletions.
1 change: 1 addition & 0 deletions etch-runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
69 changes: 69 additions & 0 deletions etch-runtime/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import de.undercouch.gradle.tasks.download.Download
import de.undercouch.gradle.tasks.download.Verify

plugins {
id 'de.undercouch.download' version "5.6.0"
id 'java-library'
id 'maven-publish'
}

java {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}


def isRunningOnJitpack = System.getenv("JITPACK") == "true"
tasks.register('downloadEtch', Download) {
if (isRunningOnJitpack)
// 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"
}
tasks.register('verifyEtch', Verify) {
dependsOn downloadEtch
src file("${buildDir}/etch/apache-etch-1.4.0-windows-x86-bin.zip")
algorithm "SHA-512"
checksum "915128A2E6E6FA83F4A576EBAC4DA5A250EC6F3BEB11C76404664B5067CFD94703531219" +
"6CAB6BB6EF96EEB765E39A87E11E774A59257E7932F2D3761CAE0354"
}

tasks.register('extractEtch', Copy) {
dependsOn verifyEtch
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"
}
tasks.register('extractEtchClasses', Copy) {
dependsOn extractEtch
from zipTree(file("${buildDir}/etch/apache-etch-1.4.0/binding-java/lib/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 extractEtchClasses
compileJava.mustRunAfter extractEtchClasses


group = 'org.apache.etch'
version = '1.4.0'

publishing {
publications {
maven(MavenPublication) {
// package names for Maven/Jitpack
groupId 'org.apache.etch'
artifactId 'etch'
version '1.4.0'

from components.java
}
}
}
20 changes: 1 addition & 19 deletions etch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ apply plugin: 'maven-publish'


dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
api project(path: ':etch')
}

sourceSets {
Expand Down Expand Up @@ -57,27 +57,9 @@ tasks.register('compileEtch', JavaExec) {
inputs.file("${rootDir}/etch/BMWRemoting.etch")
outputs.dir "${buildDir}/generated"
}
tasks.register('enableEtchRuntime', Copy) {
dependsOn extractEtchCompiler
from "${buildDir}/etch/apache-etch-1.4.0/binding-java/lib"
include '*.jar'
into file("libs/")
}
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 enableEtchRuntime

group = 'io.bimmergestalt'
version = '0.7'
Expand Down
5 changes: 3 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include ':core', ':etch'
include ':core', ':etch', ':etch-runtime'
project(':core').name = "idriveconnectkit"
project(':etch').name = "idriveconnectkit-etch"
project(':etch').name = "idriveconnectkit-etch"
project(':etch-runtime').name = "etch"

0 comments on commit db58d8e

Please sign in to comment.