Ensure build native first before compile java code

This commit is contained in:
halx99 2021-04-20 20:25:32 +08:00
parent 612710b1b6
commit 3ff5b16847
7 changed files with 63 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

@ -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

@ -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

@ -100,3 +100,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
}
}