Wish Addition to #CustomBuildAction

Do you need/want "Variables" which can be uses in CustomBuildActions?

  • No

    Votes: 0 0.0%
  • I dont know

    Votes: 0 0.0%

  • Total voters
    3
  • Poll closed .

DonManfred

Expert
Licensed User
Longtime User
Hallo,

I want to know whether a app is is compiled in RELEASE-Mode or even one of the other possibilities...

#CustomBuildAction 4,tooltostart.exe, x:\path\to\project.b4a /mode=%%mode%%
And "%%mode%%" would be replaced by b4a before running this tool to Either Release, Debug, Rapid or Obfuscated. Is it possible to get such a "Variable" to be usable in cumstomBuildAction?

%%mode%% = [Release, Debug, Rapid, Obfuscated]
%%project%% = Path and Name of actual loaded Project. (Path and name to b4a-file)

It would be great to get this in B4A in future... It should be possible to make dirfferent tools which can help in compiling-phase... A autoincrement for versioncode for example. Or a program which uploads the apk to some ftp or whatever.. . I have a lot of ideas what could be possible with such an addition to b4a...

To all reading this: Please VOTE for this feature :)
 

DonManfred

Expert
Licensed User
Longtime User
the most of

- Before/After Code Analyze [CA]
- Before/After PreCompiling to Java [CJ]
- Before/After Compiling to Bytecode [CB]
- Before/After Generating APK [GA]
- Before/After Transferring to Device [TD]

should be possible with this one here...

#CustomBuildAction 4,tooltostart.exe, x:\path\to\project.b4a /mode=%%mode%%

Look at the CustomBuildAction documentation. The 4 in this ex can have 1to6 if i remember...

If you dont need the compiling mode (debug, release) then you can realize them already TODAY


-------------------------------------------

Custom Build Actions

The build process is made of a number of steps. You can add additional steps that will run as part of the build process. For example you can run a batch file that will copy the latest resource files from some folder before the files are packed.

Another example. You can use this code to mark all files under res folder as read-only (and prevent the compiler from deleting them):
Code:
#CustomBuildAction: 1, c:\windows\system32\attrib.exe, +r res\*.* /s
Note that you can add any number of build actions.
CustomBuildAction should be added to the main activity.
The running folder is set to the program objects folder.
The syntax is:
<step id>, <program to run>, <program arguments>

step id can be one of the following:
1 - Before the compiler cleans the objects folder (it happens after the code is parsed).
2 - Before R.java file is generated.
3 - Before the package is signed (the APK file at this point is: bin\temp.ap_).
4 - Before the APK is installed.
5 - After the APK is installed.
 

DonManfred

Expert
Licensed User
Longtime User
if i have a deeper look at the possibilities and my post from this morning...

- Before Code Analyze
not possible i think

- After Code Analyze
this is 1

- Before PreCompiling to Java [CJ]
this is 1
- After PreCompiling to Java [CJ]
this is 2
- Before/After Compiling to Bytecode [CB]
not possible i think. The temp.apk is already compiled after 2...

- Before Generating APK [GA]
must be 1 i think
- After Generating APK [GA]
this is 3. apk is bin\temp.ap_

- Before Transferring to Device [TD]
this is 4

- After Transferring to Device [TD]
this is 5


But, like i said, the most of them are possible. :)
 

Similar Threads

D
  • Article
Android Code Snippet CustomBuildAction
Replies
0
Views
4K
Deleted member 103
D
Top