Ensure build native first before compile java code

This commit is contained in:
halx99 2021-04-20 20:25:32 +08:00
parent e6467fac7b
commit c2596efd04
5 changed files with 45 additions and 0 deletions

View File

@ -94,3 +94,12 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':libcocos2dx')
}
project.afterEvaluate {
if (tasks.findByName("externalNativeBuildDebug")) {
compileDebugJavaWithJavac.dependsOn externalNativeBuildDebug
}
if (tasks.findByName("externalNativeBuildRelease")) {
compileReleaseJavaWithJavac.dependsOn externalNativeBuildRelease
}
}

View File

@ -101,6 +101,15 @@ android.applicationVariants.all { variant ->
tasks.getByName("pre${targetName}Build").dependsOn copyTaskName
}
project.afterEvaluate {
if (tasks.findByName("externalNativeBuildDebug")) {
compileDebugJavaWithJavac.dependsOn externalNativeBuildDebug
}
if (tasks.findByName("externalNativeBuildRelease")) {
compileReleaseJavaWithJavac.dependsOn externalNativeBuildRelease
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':libcocos2dx')

View File

@ -91,3 +91,12 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':libcocos2dx')
}
project.afterEvaluate {
if (tasks.findByName("externalNativeBuildDebug")) {
compileDebugJavaWithJavac.dependsOn externalNativeBuildDebug
}
if (tasks.findByName("externalNativeBuildRelease")) {
compileReleaseJavaWithJavac.dependsOn externalNativeBuildRelease
}
}

View File

@ -93,3 +93,12 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':libcocos2dx')
}
project.afterEvaluate {
if (tasks.findByName("externalNativeBuildDebug")) {
compileDebugJavaWithJavac.dependsOn externalNativeBuildDebug
}
if (tasks.findByName("externalNativeBuildRelease")) {
compileReleaseJavaWithJavac.dependsOn externalNativeBuildRelease
}
}

View File

@ -108,3 +108,12 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':libcocos2dx')
}
project.afterEvaluate {
if (tasks.findByName("externalNativeBuildDebug")) {
compileDebugJavaWithJavac.dependsOn externalNativeBuildDebug
}
if (tasks.findByName("externalNativeBuildRelease")) {
compileReleaseJavaWithJavac.dependsOn externalNativeBuildRelease
}
}