#1 2016-02-04 15:24:26

pfisterhamj
Member
Registered: 2015-08-28
Posts: 10

Feature request: Define environment in BatchFiles for Android

Hello,

my Android environment is splitted. This means that I have a seperate HD or partition where I have Java, Ant and the AndroidSDK installed. Due to the fact that I develop in Java too the JAVA_HOME environment variable is not set systemwide.

I've tested that the following entries in the Batchfiles would work awesome:

REM Created by App Builder v2016.59
REM More information at [url]http://www.davidesperalta.com/[/url]

@ECHO OFF

SET JAVA_HOME=c:\Program Files\Java\jdk1.8.0_71\
SET ANT_HOME=c:\Program Files\apache-ant-1.9.6\
SET ANDROID_HOME=d:\android-sdk
SET PATH=%PATH%;%ANT_HOME%\bin;%JAVA_HOME%\bin;%ANDROID_HOME%\platform-tools

CLS

REM Add the Android platform for our app
CALL cordova platform add android

REM Add the Whitelist plugin for our app
CALL cordova plugin add cordova-plugin-whitelist

REM Add the "cordova-plugin-flashlight" plugin by the "Flashlight" plugin
CALL cordova plugin add cordova-plugin-flashlight

REM Build our app for the Android platform
CALL cordova build android

REM Pause the script execution, so we can view the script results
PAUSE

It would be nice if I can input such initialization code in AppBuilder and the stuff is written at first (after the @echo off) out to the batch files.

Thanks

Best regards
Jürgen

Offline

#2 2016-02-04 15:45:23

edunt
Member
Registered: 2015-12-21
Posts: 258

Re: Feature request: Define environment in BatchFiles for Android

Hi,

There is no need to add your request as a feature because not everybody settings are messy up.

@ECHO OFF

SET JAVA_HOME=c:\Program Files\Java\jdk1.8.0_71\
SET ANT_HOME=c:\Program Files\apache-ant-1.9.6\
SET ANDROID_HOME=d:\android-sdk
SET PATH=%PATH%;%ANT_HOME%\bin;%JAVA_HOME%\bin;%ANDROID_HOME%\platform-tools
PAUSE

If you think you might want to always run above script then open Notepad paste the code inside and save it as ANYNAME YOU WANT with .bat at the end.

REM Add the Android platform for our app
CALL cordova platform add android

REM Add the Whitelist plugin for our app
CALL cordova plugin add cordova-plugin-whitelist

REM Add the "cordova-plugin-flashlight" plugin by the "Flashlight" plugin
CALL cordova plugin add cordova-plugin-flashlight

REM Build our app for the Android platform
CALL cordova build android

REM Pause the script execution, so we can view the script results
PAUSE

If you follow AppBuilder news, there is always new updates. David is really committed and response quickly to help.

Thanks

Offline

#3 2016-02-04 16:03:15

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Feature request: Define environment in BatchFiles for Android

Hello Jürgen and edunt,

Honestly I never thinking in this before, but, work with Java (and other tools) and also with App Builder did not sound wrong, iust I am never point in that situation and then BAT files works well. But I think your proposal is reasonable Jürgen, so let me some time to consider what can be the best possible solution here.

Offline

#4 2016-02-04 16:45:30

edunt
Member
Registered: 2015-12-21
Posts: 258

Re: Feature request: Define environment in BatchFiles for Android

David wrote:

Hello Jürgen and edunt,

Honestly I never thinking in this before, but, work with Java (and other tools) and also with App Builder did not sound wrong, iust I am never point in that situation and then BAT files works well. But I think your proposal is reasonable Jürgen, so let me some time to consider what can be the best possible solution here.

Hi,

Ok, there will be some issues for AB beginner users i.e if version numbers changed on Java, and Ant, they might not know how to go about it.

Thanks

Offline

#5 2016-02-04 16:53:30

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Feature request: Define environment in BatchFiles for Android

Hello,

edunt wrote:

Ok, there will be some issues for AB beginner users i.e if version numbers changed on Java, and Ant, they might not know how to go about it.

Yes; certainly some implementation can cause problems to beginner users. My plain right now is to add these options completely optional: if we define some specific thing like "JAVA_HOME", then the program take care about. If you just ommit these variables, then the generated BAT files continues exactly like now.

Offline

#6 2016-02-04 19:01:22

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Feature request: Define environment in BatchFiles for Android

Hello to all,

Jürgen, update your App Builder copy. Now we can specify the Ant, Java and Android home (one, two or three) in order to be placed in the right way into the generated Batch files. I test right now and works fine, but please, try it by yourself and tell me if this can help you or what.

iZSV2wb.png

Offline

#7 2016-02-06 04:19:35

pfisterhamj
Member
Registered: 2015-08-28
Posts: 10

Re: Feature request: Define environment in BatchFiles for Android

Thanks David. That helps me a lot.

Kind regards
Juergen

Offline

#8 2016-02-06 09:51:39

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: Feature request: Define environment in BatchFiles for Android

You're welcome! smile

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.