diff --git a/Build_AtomicEditor.sh b/Build_AtomicEditor.sh index 307d0a0202..1266de1ce8 100755 --- a/Build_AtomicEditor.sh +++ b/Build_AtomicEditor.sh @@ -1,9 +1,9 @@ #!/usr/bin/env sh if [ "$(uname)" = "Darwin" ]; then - ./Build/Mac/node/node ./Build/node_modules/jake/bin/cli.js -f ./Build/Scripts/Bootstrap.js build:atomiceditor + ./Build/Mac/node/node ./Build/node_modules/jake/bin/cli.js -f ./Build/Scripts/Bootstrap.js build:atomiceditor elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then - ./Build/Linux/node/node ./Build/node_modules/jake/bin/cli.js -f ./Build/Scripts/Bootstrap.js build:atomiceditor + ./Build/Linux/node/node ./Build/node_modules/jake/bin/cli.js -f ./Build/Scripts/Bootstrap.js build:atomiceditor elif [ "$(expr substr $(uname -s) 1 7)" = "MSYS_NT" ]; then - ./Build/Windows/node/node.exe ./Build/node_modules/jake/bin/cli.js -f ./Build/Scripts/Bootstrap.js build:atomiceditor + ./Build/Windows/node/node.exe ./Build/node_modules/jake/bin/cli.js -f ./Build/Scripts/Bootstrap.js build:atomiceditor fi diff --git a/Script/AtomicEditor/ui/modal/build/platforms/AndroidSettingsWidget.ts b/Script/AtomicEditor/ui/modal/build/platforms/AndroidSettingsWidget.ts index 1a0dc1305e..64d4f16030 100644 --- a/Script/AtomicEditor/ui/modal/build/platforms/AndroidSettingsWidget.ts +++ b/Script/AtomicEditor/ui/modal/build/platforms/AndroidSettingsWidget.ts @@ -31,7 +31,7 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind this.load("AtomicEditor/editor/ui/buildsettings_android.tb.txt"); this.settings = ToolCore.toolSystem.project.buildSettings.androidBuildSettings; - + this.sdkPathEdit = this.getWidget("sdk_path"); this.sdkTargetSelect = this.getWidget("sdk_target_select"); this.appNameEdit = this.getWidget("app_name"); @@ -52,14 +52,14 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind this.iconNameEdit = this.getWidget("icon_root"); this.iconChooseButton = this.getWidget("choose_icon"); this.iconImage = this.getWidget("and_icon"); - + if (Atomic.platform == "Windows") { jdkRootText.text = "JDK Root: (Ex. C:\\Program Files\\Java\\jdk1.8.0_31)"; antPathText.text = "Ant Path: (The folder that contains ant.bat)"; } - + this.antPathEdit = this.getWidget("ant_path"); this.refreshWidgets(); @@ -75,7 +75,7 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind if (ev.target.id == "choose_sdk_path") { var fileUtils = new Editor.FileUtils(); - var path = fileUtils.findPath("Please choose the root folder of your Android SDK",""); + var path = fileUtils.findPath("Please choose the root folder of your Android SDK" , ""); if ( path.length > 0 ) this.sdkPathEdit.text = path; @@ -93,7 +93,7 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind } else if (ev.target.id == "choose_jdk_root") { var fileUtils = new Editor.FileUtils(); - var path = fileUtils.findPath("Please choose the root folder of your JDK",""); + var path = fileUtils.findPath("Please choose the root folder of your JDK" , ""); if ( path.length > 0 ) this.jdkRootEdit.text = path; @@ -107,23 +107,22 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind var fileUtils = new Editor.FileUtils(); var path = fileUtils.findPath( "Please choose the folder of your ant.properties", ""); if ( path.length > 0 ) - this.releaseNameEdit.text = path; + this.releaseNameEdit.text = path; return true; } else if (ev.target.id == "choose_icon") { var fileUtils = new Editor.FileUtils(); - var path = fileUtils.findPath("Please choose the folder with drawable folders",""); - if ( path.length > 0 ) - { + var path = fileUtils.findPath("Please choose the folder with drawable folders" , ""); + if ( path.length > 0 ) { this.iconNameEdit.text = path; this.updateIconButton(); } return true; - - } + + } } - + return false; } @@ -153,9 +152,9 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind }); } - + updateIconButton() { - + var fileSystem = Atomic.getFileSystem(); if ( this.iconNameEdit.text.length > 0 ) { @@ -172,7 +171,7 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind this.iconImage.setImage( defaulticon ); } - + refreshWidgets() { @@ -227,11 +226,11 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind packageNameEdit: Atomic.UIEditField; productNameEdit: Atomic.UIEditField; companyNameEdit: Atomic.UIEditField; - + releaseNameEdit : Atomic.UIEditField; releaseChooseButton : Atomic.UIButton; releaseCheck : Atomic.UICheckBox; - iconNameEdit : Atomic.UIEditField; + iconNameEdit : Atomic.UIEditField; iconChooseButton : Atomic.UIButton; iconImage : Atomic.UIImageWidget; } diff --git a/Source/ToolCore/Build/AndroidProjectGenerator.cpp b/Source/ToolCore/Build/AndroidProjectGenerator.cpp index b9905d7921..1a39c0be5e 100644 --- a/Source/ToolCore/Build/AndroidProjectGenerator.cpp +++ b/Source/ToolCore/Build/AndroidProjectGenerator.cpp @@ -37,8 +37,9 @@ namespace ToolCore { -AndroidProjectGenerator::AndroidProjectGenerator(Context* context) : - Object(context) +AndroidProjectGenerator::AndroidProjectGenerator(Context* context, BuildBase* buildBase) : + Object(context), + buildBase_(buildBase) { } @@ -48,7 +49,7 @@ AndroidProjectGenerator::~AndroidProjectGenerator() } -bool AndroidProjectGenerator::Generate( BuildBase *baseOps ) +bool AndroidProjectGenerator::Generate() { if (!GenerateAndroidManifest()) return false; @@ -56,7 +57,7 @@ bool AndroidProjectGenerator::Generate( BuildBase *baseOps ) if (!GenerateStringXML()) return false; - if (!GenerateLocalProperties(baseOps)) + if (!GenerateLocalProperties()) return false; if (!GenerateProjectProperties()) @@ -65,7 +66,7 @@ bool AndroidProjectGenerator::Generate( BuildBase *baseOps ) if (!GenerateActivitySource()) return false; - if (!CopyUserIcons(baseOps)) + if (!CopyUserIcons()) return false; return true; @@ -122,7 +123,7 @@ bool AndroidProjectGenerator::GenerateActivitySource() } -bool AndroidProjectGenerator::GenerateLocalProperties( BuildBase *fileOps ) +bool AndroidProjectGenerator::GenerateLocalProperties( ) { ToolEnvironment* tenv = GetSubsystem(); ToolPrefs* prefs = tenv->GetToolPrefs(); @@ -165,7 +166,7 @@ bool AndroidProjectGenerator::GenerateLocalProperties( BuildBase *fileOps ) return false; } - if ( !fileOps->BuildCopyFile ( antname, buildPath_ + "/ant.properties" )) + if ( !buildBase_->BuildCopyFile ( antname, buildPath_ + "/ant.properties" )) return false; } @@ -313,7 +314,7 @@ bool AndroidProjectGenerator::GenerateAndroidManifest() } -bool AndroidProjectGenerator::CopyUserIcons( BuildBase *fileOps ) +bool AndroidProjectGenerator::CopyUserIcons() { FileSystem* fileSystem = GetSubsystem(); ToolSystem* toolSystem = GetSubsystem(); @@ -329,7 +330,7 @@ bool AndroidProjectGenerator::CopyUserIcons( BuildBase *fileOps ) String destDir = buildPath_ + "/res/drawable"; // where it should be in the build if ( fileSystem->FileExists (userIconFile) ) // is there a file there? { - if ( !fileOps->BuildCopyFile ( userIconFile, destDir + "/logo_large.png" )) + if ( !buildBase_->BuildCopyFile ( userIconFile, destDir + "/logo_large.png" )) return false; } @@ -338,7 +339,7 @@ bool AndroidProjectGenerator::CopyUserIcons( BuildBase *fileOps ) destDir = buildPath_ + "/res/drawable-ldpi"; if ( fileSystem->FileExists (userIconFile) ) { - if ( !fileOps->BuildCopyFile ( userIconFile, destDir + "/icon.png")) + if ( !buildBase_->BuildCopyFile ( userIconFile, destDir + "/icon.png")) return false; } @@ -346,7 +347,7 @@ bool AndroidProjectGenerator::CopyUserIcons( BuildBase *fileOps ) userIconFile = userIconDir + "/icon.png"; destDir = buildPath_ + "/res/drawable-mdpi"; { - if ( !fileOps->BuildCopyFile ( userIconFile, destDir + "/icon.png" )) + if ( !buildBase_->BuildCopyFile ( userIconFile, destDir + "/icon.png" )) return false; } @@ -355,7 +356,7 @@ bool AndroidProjectGenerator::CopyUserIcons( BuildBase *fileOps ) destDir = buildPath_ + "/res/drawable-hdpi"; if ( fileSystem->FileExists (userIconFile) ) { - if ( !fileOps->BuildCopyFile ( userIconFile, destDir + "/icon.png" )) + if ( !buildBase_->BuildCopyFile ( userIconFile, destDir + "/icon.png" )) return false; } diff --git a/Source/ToolCore/Build/AndroidProjectGenerator.h b/Source/ToolCore/Build/AndroidProjectGenerator.h index 3aaf50b3aa..7b452c3a38 100644 --- a/Source/ToolCore/Build/AndroidProjectGenerator.h +++ b/Source/ToolCore/Build/AndroidProjectGenerator.h @@ -40,12 +40,12 @@ class AndroidProjectGenerator : public Object public: - AndroidProjectGenerator(Context* context); + AndroidProjectGenerator(Context* context, BuildBase *buildBase); virtual ~AndroidProjectGenerator(); void SetBuildPath(const String& buildpath) { buildPath_ = buildpath; } - bool Generate( BuildBase * ); + bool Generate(); const String& GetErrorText() { return errorText_; } @@ -53,11 +53,12 @@ class AndroidProjectGenerator : public Object bool GenerateAndroidManifest(); bool GenerateStringXML(); - bool GenerateLocalProperties(BuildBase *); + bool GenerateLocalProperties(); bool GenerateProjectProperties(); bool GenerateActivitySource(); - bool CopyUserIcons( BuildBase *); + bool CopyUserIcons( ); + WeakPtr buildBase_; String buildPath_; String errorText_; diff --git a/Source/ToolCore/Build/BuildAndroid.cpp b/Source/ToolCore/Build/BuildAndroid.cpp index 691519235e..86d35ece38 100644 --- a/Source/ToolCore/Build/BuildAndroid.cpp +++ b/Source/ToolCore/Build/BuildAndroid.cpp @@ -386,14 +386,14 @@ void BuildAndroid::Build(const String& buildPath) //check for Deployment/Android/libs/armeabi-v7a/libAtomicPlayer.so if ( !fileSystem->FileExists(androidProject + "/libs/armeabi-v7a/libAtomicPlayer.so") ) { - FailBuild( " the file libAtomicPlayer.so is not found. This is required for APK generation." ); + FailBuild( "The file libAtomicPlayer.so is not found. This is required for APK generation." ); return; } - AndroidProjectGenerator gen(context_); + AndroidProjectGenerator gen(context_, this); gen.SetBuildPath(buildPath_); - if (!gen.Generate( static_cast(this))) + if (!gen.Generate()) { FailBuild(gen.GetErrorText()); return;