Skip to content

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
Signed-off-by: Yauheni Khnykin <[email protected]>
  • Loading branch information
Hsilgos committed Jan 1, 2024
1 parent b447e55 commit 153d340
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 79 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.22.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:5.1.13"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.23.3"

modules {
module("org.jetbrains.trove4j:trove4j") {
Expand Down
21 changes: 20 additions & 1 deletion functional-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,33 @@ public class BuildCMakeNativeHost extends DefaultTask {

ext.BuildCMakeNativeHost = BuildCMakeNativeHost

static def dependJavaTasksOnNativeBuild(tasks, isHostOnly) {
tasks.configureEach { task ->
['Debug', 'Release'].each { buildType ->
if (task.name == "javaPreCompile${buildType}" ||
task.name == "javaPreCompile${buildType}UnitTest" ||
task.name == "compile${buildType}UnitTestJavaWithJavac" ||
task.name == "package${buildType}Resources" ||
task.name == "generate${buildType}ResValues" ||
task.name == "process${buildType}Manifest") {
if (isHostOnly) {
task.dependsOn "build${buildType}NativeHost"
} else {
task.dependsOn "externalNativeBuild${buildType}"
}
}
}
}
}

buildscript {
repositories {
google()
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.2'
classpath 'com.android.tools.build:gradle:8.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20"

def gluecodiumVersion = project.hasProperty('gluecodiumVersion')
Expand Down
23 changes: 6 additions & 17 deletions functional-tests/functional/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,20 @@ android {
def typeName = variant.name
def typeCapitalised = typeName.capitalize()

def buildNativeProject = task("build${typeCapitalised}NativeHost", type: BuildCMakeNativeHost) {
tasks.register("build${typeCapitalised}NativeHost", BuildCMakeNativeHost) {
projectDir = rootProject.projectDir
buildDir = file(buildNativeHostDir('functional', typeName))
cmakeParameters = getCMakeCommonParameters()
target = 'functional'
buildType = variant.buildType.name
dependsOn("generate${typeCapitalised}BuildConfig")
}

buildConfigField "String", "NATIVE_LIB_HOST_DIR", "\"${buildNativeHostDir('functional', typeName)}/functional\""
}
}

task generateJavadoc(type: Javadoc) {
tasks.register('generateJavadoc', Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += files(android.getBootClasspath().join(File.pathSeparator))
exclude '**/jni/**', '**.xml'
Expand All @@ -114,21 +115,9 @@ task generateJavadoc(type: Javadoc) {
}
}

tasks.configureEach { task ->
// Java compilation depends on .java/.jar files created by CMake
if (task.name == 'javaPreCompileDebug' || task.name == 'compileDebugUnitTestJavaWithJavac') {
if (!rootProject.isHostOnly()) {
task.dependsOn 'externalNativeBuildDebug'
}
task.dependsOn 'buildDebugNativeHost'
}
if (task.name == 'javaPreCompileRelease' || task.name == 'compileReleaseUnitTestJavaWithJavac') {
if (!rootProject.isHostOnly()) {
task.dependsOn 'externalNativeBuildRelease'
}
task.dependsOn 'buildReleaseNativeHost'
}
dependJavaTasksOnNativeBuild(tasks, rootProject.isHostOnly())

tasks.configureEach { task ->
if (task.name == 'generateJavadoc') {
task.mustRunAfter 'buildDebugNativeHost', 'buildReleaseNativeHost', 'externalNativeBuildDebug', 'externalNativeBuildRelease'
}
Expand All @@ -139,7 +128,7 @@ dependencies {

testImplementation 'junit:junit:4.13.2'
testImplementation "org.powermock:powermock-reflect:2.0.9"
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.robolectric:robolectric:4.11.1'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
}
Expand Down
3 changes: 2 additions & 1 deletion functional-tests/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
minifyDebugBuilds=false
org.gradle.jvmargs=-Xmx4096m
android.useAndroidX=true
android.useAndroidX=true
android.defaults.buildfeatures.buildconfig=true
45 changes: 26 additions & 19 deletions functional-tests/namerules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ apply plugin: 'com.android.library'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

project.buildDir = "${rootProject.buildDir}"

def getCMakeCommonParameters() {
Expand Down Expand Up @@ -79,37 +77,46 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}

libraryVariants.all { variant ->
def typeName = variant.name
def typeCapitalised = typeName.capitalize()

def buildNativeProject = task("build${typeCapitalised}NativeHost", type: BuildCMakeNativeHost) {
tasks.register("build${typeCapitalised}NativeHost", BuildCMakeNativeHost) {
projectDir = project.projectDir
buildDir = file(buildNativeHostDir('namerules', typeName))
cmakeParameters = getCMakeCommonParameters()
target = 'namerules'
buildType = variant.buildType.name
dependsOn("generateGluecodiumSources")
}

buildConfigField "String", "NATIVE_LIB_HOST_DIR", "\"${buildNativeHostDir('namerules', typeName)}\""
}
}

tasks.configureEach { task ->
// Java compilation depends on .java/.jar files created by CMake
if (task.name == 'javaPreCompileDebug' || task.name == 'compileDebugUnitTestJavaWithJavac') {
if (!rootProject.isHostOnly()) {
task.dependsOn 'externalNativeBuildDebug'
}
task.dependsOn 'buildDebugNativeHost'
}
if (task.name == 'javaPreCompileRelease' || task.name == 'compileReleaseUnitTestJavaWithJavac') {
if (!rootProject.isHostOnly()) {
task.dependsOn 'externalNativeBuildRelease'
}
task.dependsOn 'buildReleaseNativeHost'
}
}
dependJavaTasksOnNativeBuild(tasks, rootProject.isHostOnly())

// tasks.configureEach { task ->
// // Java compilation depends on .java/.jar files created by CMake
// ['Debug', 'Release'].each { buildType ->
// if (task.name == "javaPreCompile${buildType}" ||
// task.name == "javaPreCompile${buildType}UnitTest" ||
// task.name == "compile${buildType}UnitTestJavaWithJavac" ||
// task.name == "package${buildType}Resources" ||
// task.name == "generate${buildType}ResValues" ||
// task.name == "process${buildType}Manifest") {
// if (rootProject.isHostOnly()) {
// task.dependsOn "build${buildType}NativeHost"
// } else {
// task.dependsOn "externalNativeBuild${buildType}"
// }
// }
// }
// }

dependencies {
implementation 'androidx.annotation:annotation:1.1.0'
Expand All @@ -119,7 +126,7 @@ dependencies {

testImplementation 'junit:junit:4.13.2'
testImplementation "org.powermock:powermock-reflect:2.0.9"
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.robolectric:robolectric:4.11.1'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
}
Expand Down
2 changes: 1 addition & 1 deletion functional-tests/scripts/build-android-functional
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ TMP_DIR=$(mktemp -d)
if $HOST_ONLY; then
./gradlew functional:testRelease -PhostOnly -PgluecodiumVersion=${GLUECODIUM_VERSION}
else
./gradlew functional:testRelease -PgluecodiumVersion=${GLUECODIUM_VERSION}
./gradlew functional:testRelease -PgluecodiumVersion=${GLUECODIUM_VERSION} --info
fi

if [ "$GENERATE_DOCS" = true ]; then
Expand Down
8 changes: 4 additions & 4 deletions gluecodium-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ repositories {
dependencies {
implementation project(":gluecodium")

implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
implementation('com.android.tools.build:gradle:7.2.1') {
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.22'
implementation('com.android.tools.build:gradle:8.2.0') {
exclude group: 'net.sf.proguard', module: 'proguard-gradle'
}
implementation 'com.natpryce:konfig:1.6.10.0'

testImplementation 'io.mockk:mockk-dsl-jvm:1.12.2'
testImplementation 'io.mockk:mockk:1.12.2'
testImplementation 'io.mockk:mockk-dsl-jvm:1.13.8'
testImplementation 'io.mockk:mockk:1.13.8'
testImplementation 'junit:junit:4.13.2'
}

Expand Down
26 changes: 13 additions & 13 deletions gluecodium/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ dependencies {
implementation project(":lime-loader")

compileOnly 'com.android.tools:annotations:25.3.0'
implementation 'com.google.guava:guava:31.1-jre'
implementation 'com.google.guava:guava:33.0.0-jre'
implementation 'com.natpryce:konfig:1.6.10.0'
implementation 'com.vladsch.flexmark:flexmark:0.64.0'
implementation 'com.vladsch.flexmark:flexmark-ext-tables:0.64.0'
implementation 'com.vladsch.flexmark:flexmark-util:0.64.0'
implementation 'commons-cli:commons-cli:1.5.0'
implementation 'org.apache.logging.log4j:log4j-core:2.18.0'
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.6.21'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
implementation 'org.jetbrains:annotations:23.0.0'
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'org.slf4j:slf4j-log4j12:1.7.36'
implementation 'com.vladsch.flexmark:flexmark:0.64.8'
implementation 'com.vladsch.flexmark:flexmark-ext-tables:0.64.8'
implementation 'com.vladsch.flexmark:flexmark-util:0.64.8'
implementation 'commons-cli:commons-cli:1.6.0'
implementation 'org.apache.logging.log4j:log4j-core:2.22.1'
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.9.22'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.22'
implementation 'org.jetbrains:annotations:24.1.0'
implementation 'org.slf4j:slf4j-api:2.0.10'
implementation 'org.slf4j:slf4j-log4j12:2.0.10'
implementation 'org.trimou:trimou-core:2.5.1.Final'

testImplementation files({ project(":lime-runtime").sourceSets.test.output })
testImplementation 'io.mockk:mockk-dsl-jvm:1.12.5'
testImplementation 'io.mockk:mockk:1.12.5'
testImplementation 'io.mockk:mockk-dsl-jvm:1.13.8'
testImplementation 'io.mockk:mockk:1.13.8'
testImplementation 'junit:junit:4.13.2'
}

Expand Down
28 changes: 8 additions & 20 deletions lime-loader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@ plugins {
}

dependencies {
//antlr "org.antlr:antlr4:4.13.1"
antlr "org.antlr:antlr4:4.9.1"
antlr "org.antlr:antlr4:4.13.1"
api project(":lime-runtime")
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.21'
implementation "org.antlr:antlr4-runtime:4.9.1"
// implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.20'
// implementation "org.antlr:antlr4-runtime:4.13.1"
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.22'
implementation "org.antlr:antlr4-runtime:4.13.1"

testImplementation files({ project(":lime-runtime").sourceSets.test.output })
testImplementation 'io.mockk:mockk-dsl-jvm:1.12.5'
testImplementation 'io.mockk:mockk:1.12.5'
// testImplementation 'io.mockk:mockk-dsl-jvm:1.13.8'
// testImplementation 'io.mockk:mockk:1.13.8'
testImplementation 'io.mockk:mockk-dsl-jvm:1.13.8'
testImplementation 'io.mockk:mockk:1.13.8'
testImplementation 'junit:junit:4.13.2'
}

Expand Down Expand Up @@ -52,16 +47,9 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
dependsOn(tasks.withType(AntlrTask))
}

// tasks.configureEach { task ->
// if (task.name == 'generateAntlrGeneratedGrammarSource') {
// task.dependsOn('compileAntlrGeneratedKotlin')
// }
// if (task.name == 'generateGrammarSource') {
// task.dependsOn('compileAntlrGeneratedKotlin')
// task.dependsOn('compileAntlrGeneratedJava')
// task.dependsOn('sourcesJar')
// }
// }
tasks.withType(Jar).configureEach {
dependsOn(tasks.withType(AntlrTask))
}

apply from: "$rootDir/gradle/spotless.gradle"

Expand Down

0 comments on commit 153d340

Please sign in to comment.