Skip to content

Commit

Permalink
Minor cleanups and TS lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshEngebretson committed Jul 2, 2016
1 parent d215461 commit 17905f3
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 39 deletions.
6 changes: 3 additions & 3 deletions Build_AtomicEditor.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <Atomic.UIEditField>this.getWidget("sdk_path");
this.sdkTargetSelect = <Atomic.UISelectDropdown>this.getWidget("sdk_target_select");
this.appNameEdit = <Atomic.UIEditField>this.getWidget("app_name");
Expand All @@ -52,14 +52,14 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind
this.iconNameEdit = <Atomic.UIEditField>this.getWidget("icon_root");
this.iconChooseButton = <Atomic.UIButton>this.getWidget("choose_icon");
this.iconImage = <Atomic.UIImageWidget>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 = <Atomic.UIEditField>this.getWidget("ant_path");

this.refreshWidgets();
Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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;
}

Expand Down Expand Up @@ -153,9 +152,9 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind
});

}

updateIconButton() {

var fileSystem = Atomic.getFileSystem();

if ( this.iconNameEdit.text.length > 0 ) {
Expand All @@ -172,7 +171,7 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind
this.iconImage.setImage( defaulticon );

}


refreshWidgets() {

Expand Down Expand Up @@ -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;
}
Expand Down
25 changes: 13 additions & 12 deletions Source/ToolCore/Build/AndroidProjectGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
namespace ToolCore
{

AndroidProjectGenerator::AndroidProjectGenerator(Context* context) :
Object(context)
AndroidProjectGenerator::AndroidProjectGenerator(Context* context, BuildBase* buildBase) :
Object(context),
buildBase_(buildBase)
{

}
Expand All @@ -48,15 +49,15 @@ AndroidProjectGenerator::~AndroidProjectGenerator()

}

bool AndroidProjectGenerator::Generate( BuildBase *baseOps )
bool AndroidProjectGenerator::Generate()
{
if (!GenerateAndroidManifest())
return false;

if (!GenerateStringXML())
return false;

if (!GenerateLocalProperties(baseOps))
if (!GenerateLocalProperties())
return false;

if (!GenerateProjectProperties())
Expand All @@ -65,7 +66,7 @@ bool AndroidProjectGenerator::Generate( BuildBase *baseOps )
if (!GenerateActivitySource())
return false;

if (!CopyUserIcons(baseOps))
if (!CopyUserIcons())
return false;

return true;
Expand Down Expand Up @@ -122,7 +123,7 @@ bool AndroidProjectGenerator::GenerateActivitySource()

}

bool AndroidProjectGenerator::GenerateLocalProperties( BuildBase *fileOps )
bool AndroidProjectGenerator::GenerateLocalProperties( )
{
ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
ToolPrefs* prefs = tenv->GetToolPrefs();
Expand Down Expand Up @@ -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;

}
Expand Down Expand Up @@ -313,7 +314,7 @@ bool AndroidProjectGenerator::GenerateAndroidManifest()

}

bool AndroidProjectGenerator::CopyUserIcons( BuildBase *fileOps )
bool AndroidProjectGenerator::CopyUserIcons()
{
FileSystem* fileSystem = GetSubsystem<FileSystem>();
ToolSystem* toolSystem = GetSubsystem<ToolSystem>();
Expand All @@ -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;
}

Expand All @@ -338,15 +339,15 @@ 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;
}

userIconDir = userIconPath + "/drawable-mdpi";
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;
}

Expand All @@ -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;
}

Expand Down
9 changes: 5 additions & 4 deletions Source/ToolCore/Build/AndroidProjectGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,25 @@ 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_; }

private:

bool GenerateAndroidManifest();
bool GenerateStringXML();
bool GenerateLocalProperties(BuildBase *);
bool GenerateLocalProperties();
bool GenerateProjectProperties();
bool GenerateActivitySource();
bool CopyUserIcons( BuildBase *);
bool CopyUserIcons( );

WeakPtr<BuildBase> buildBase_;
String buildPath_;
String errorText_;

Expand Down
6 changes: 3 additions & 3 deletions Source/ToolCore/Build/BuildAndroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<BuildBase*>(this)))
if (!gen.Generate())
{
FailBuild(gen.GetErrorText());
return;
Expand Down

0 comments on commit 17905f3

Please sign in to comment.