Skip to content

Commit

Permalink
Move project into a submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
hufman committed Mar 23, 2024
1 parent a3eba6a commit 4b2f6fb
Show file tree
Hide file tree
Showing 29 changed files with 122 additions and 119 deletions.
123 changes: 4 additions & 119 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import de.undercouch.gradle.tasks.download.Download
import de.undercouch.gradle.tasks.download.Verify

buildscript {
ext.kotlin_version = '1.9.0'
Expand All @@ -12,121 +10,8 @@ buildscript {
}
}

plugins {
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'

repositories {
mavenCentral()
}

dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}

sourceSets {
main.java.srcDirs += 'build/generated'
test.java.srcDirs += 'src/test/java'
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"

def isRunningOnJitpack = System.getenv("JITPACK") == "true"
tasks.register('downloadEtchCompiler', 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('verifyEtchCompiler', Verify) {
dependsOn downloadEtchCompiler
src file("${buildDir}/etch/apache-etch-1.4.0-windows-x86-bin.zip")
algorithm "SHA-512"
checksum "915128A2E6E6FA83F4A576EBAC4DA5A250EC6F3BEB11C76404664B5067CFD94703531219" +
"6CAB6BB6EF96EEB765E39A87E11E774A59257E7932F2D3761CAE0354"
}
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"
}
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",
"${buildDir}/etch/apache-etch-1.4.0/lib/apache-etch-java-compiler-1.4.0.jar",
"${buildDir}/etch/apache-etch-1.4.0/lib/velocity-1.7-dep.jar"
)
workingDir 'etch'
args('--binding', 'java', '--output-dir', "${buildDir}/generated", 'BMWRemoting.etch')
inputs.file("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
compileKotlin.dependsOn extractEtchRuntime
compileKotlin.mustRunAfter extractEtchRuntime
compileKotlin.dependsOn compileEtch
compileKotlin.dependsOn enableEtchRuntime
compileKotlin.mustRunAfter compileEtch
compileKotlin.mustRunAfter enableEtchRuntime

// https://youtrack.jetbrains.com/issue/IDEA-119280
tasks.register('copyTestResources', Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
tasks.register('copyTestResourcesOut', Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/../out/test/classes"
}
// doesn't seem to actually work, you should run this step manually
processTestResources.dependsOn copyTestResources
processTestResources.dependsOn copyTestResourcesOut

publishing {
publications {
maven(MavenPublication) {
// publish to Jitpack
groupId 'io.bimmergestalt'
artifactId 'IDriveConnectKit'
version '0.6'

from components.java
}
allprojects {
repositories {
mavenCentral()
}
}
}
117 changes: 117 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import de.undercouch.gradle.tasks.download.Download
import de.undercouch.gradle.tasks.download.Verify

plugins {
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'

dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}

sourceSets {
main.java.srcDirs += 'build/generated'
test.java.srcDirs += 'src/test/java'
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"

def isRunningOnJitpack = System.getenv("JITPACK") == "true"
tasks.register('downloadEtchCompiler', 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('verifyEtchCompiler', Verify) {
dependsOn downloadEtchCompiler
src file("${buildDir}/etch/apache-etch-1.4.0-windows-x86-bin.zip")
algorithm "SHA-512"
checksum "915128A2E6E6FA83F4A576EBAC4DA5A250EC6F3BEB11C76404664B5067CFD94703531219" +
"6CAB6BB6EF96EEB765E39A87E11E774A59257E7932F2D3761CAE0354"
}
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"
}
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",
"${buildDir}/etch/apache-etch-1.4.0/lib/apache-etch-java-compiler-1.4.0.jar",
"${buildDir}/etch/apache-etch-1.4.0/lib/velocity-1.7-dep.jar"
)
workingDir "${rootDir}/etch"
args('--binding', 'java', '--output-dir', "${buildDir}/generated", 'BMWRemoting.etch')
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
compileKotlin.dependsOn extractEtchRuntime
compileKotlin.mustRunAfter extractEtchRuntime
compileKotlin.dependsOn compileEtch
compileKotlin.dependsOn enableEtchRuntime
compileKotlin.mustRunAfter compileEtch
compileKotlin.mustRunAfter enableEtchRuntime

// https://youtrack.jetbrains.com/issue/IDEA-119280
tasks.register('copyTestResources', Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
tasks.register('copyTestResourcesOut', Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/../out/test/classes"
}
// doesn't seem to actually work, you should run this step manually
processTestResources.dependsOn copyTestResources
processTestResources.dependsOn copyTestResourcesOut

publishing {
publications {
maven(MavenPublication) {
// publish to Jitpack
groupId 'io.bimmergestalt'
artifactId 'IDriveConnectKit'
version '0.6'

from components.java
}
}
}
File renamed without changes.
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ':core'

0 comments on commit 4b2f6fb

Please sign in to comment.