Automatically insert build.gradle into an extension if it isn't there.
This commit is contained in:
committed by
Joshua Granick
parent
9d19f8a88f
commit
ecb799128b
@@ -15,6 +15,7 @@ import lime.tools.helpers.PathHelper;
|
||||
import lime.tools.helpers.ProcessHelper;
|
||||
import lime.project.Architecture;
|
||||
import lime.project.AssetType;
|
||||
import lime.project.Haxelib;
|
||||
import lime.project.HXProject;
|
||||
import lime.project.Icon;
|
||||
import lime.project.PlatformTarget;
|
||||
@@ -387,6 +388,17 @@ class AndroidPlatform extends PlatformTarget {
|
||||
|
||||
FileHelper.recursiveCopy (library.source, sourceSet + "/deps/" + library.name, context, true);
|
||||
|
||||
if (!FileSystem.exists (sourceSet + "/deps/" + library.name + "/build.gradle")) {
|
||||
|
||||
context.extensionLowerCase = library.name.toLowerCase();
|
||||
|
||||
var source = PathHelper.getHaxelib (new Haxelib ("lime")) + "templates/extension/dependencies/android/build.gradle";
|
||||
FileHelper.copyFile (source, sourceSet + "/deps/" + library.name + "/build.gradle", context, true);
|
||||
|
||||
Reflect.deleteField(context, "extensionLowerCase");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
FileHelper.recursiveCopyTemplate (project.templatePaths, "android/template", destination, context);
|
||||
|
||||
@@ -35,6 +35,9 @@ class CreateTemplate {
|
||||
context.extensionLowerCase = extension.toLowerCase ();
|
||||
context.extensionUpperCase = extension.toUpperCase ();
|
||||
context.ANDROID_TARGET_SDK_VERSION = "::ANDROID_TARGET_SDK_VERSION::";
|
||||
context.ANDROID_MINIMUM_SDK_VERSION = "::ANDROID_MINIMUM_SDK_VERSION::";
|
||||
context.META_BUILD_NUMBER = "::META_BUILD_NUMBER::";
|
||||
context.META_VERSION = "::META_VERSION::";
|
||||
|
||||
PathHelper.mkdir (title);
|
||||
FileHelper.recursiveCopyTemplate ([ PathHelper.getHaxelib (new Haxelib ("lime"), true) + "/templates" ], "extension", title, context);
|
||||
|
||||
Reference in New Issue
Block a user