Command line build?

Hi,

I’m guessing the answer is no since I couldn’t find anything in the forums, but is it possible to start a build from the command line? HTML5 specifically.

-dev

Let me move this to the HTML5 forum.

Rob

Hi,

I’ve handled it for now using an AppleScript, but still curious for cross platform usage.

-dev

This was brought up before, https://forums.coronalabs.com/topic/61405-scripting-build/. I am doing the same as you and using Automator but it is not an ideal solution. I really wanted it more for my Jenkins setup.

Would be nice to have something like this available to launch a simulator build from the command line. 

My thoughts was to be able to load the corona simulator from the terminal passing parameters to it:

 

For example:

 

/Applications/CoronaSDK/Corona Simulator.app -build Android -name “May App Name” -version “1.0” -package “com.mycompany.myapp” -keystore /path/to/my/keystore -keyalias “alias” -output /path/to/apk/output

 

Builds would still happen as they do now in the cloud. 

OK. With 3247 you can do something like this on macOS:

builder=~/Library/Application\ Support/Corona/Native/Corona/mac/bin/CoronaBuilder.app/Contents/MacOS/CoronaBuilder ${builder} build --lua build.lua 

On Windows will work in 3248 (minor bug in 3247 breaks a build)

cd "%CORONA\_PATH%" Native\Corona\win\bin\CoronaBuilder.exe build --lua Z:\Projects\b2-win-html.lua

 
with contents of build.lua:

local params = {   platform='html5',   appName='2 Player Html',   appVersion='1.0',   dstPath='/Users/vlad/Projects/myCoolApp',   projectPath='/Users/vlad/CoronaBuiltApps',   -- includeStandardResources=false, } return params

And make sure to run Native/Setup Corona Native.app

Cheers!

Hi,

Thank you very much for adding this ability.  :smiley:

I had to end up using:

builder=/Applications/Corona-3248/Native/Corona/mac/bin/CoronaBuilder.app/Contents/MacOS/CoronaBuilder

I assume that is because I am using a daily build? It works great though.

-dev

Vlad,

This is amazing!! Thanks this will help so much. I did see that Android is not implemented yet, do you know when it might be?

Thanks,

Steve

Hi,

@vlads This is working great on macOS, but I’m not having as good as luck on Windows 10.

No matter how I go about it I get the following lines at the start of the build:

CoronaBuilder: building project with 'C:\Users\develephant\Documents\Corona Projects\build.lua' Current authorization is 'Corona' for user '\<my-email\>' Building app 'browserInfo' Version '1.0' Platform 'HTML5' PlatformVersion '-1' Project: 'C:\Users\develephant\Documents\Corona Projects' Dst: 'C:\Users\develephant\Documents\Corona Projects\htmlbuild' Custom build id: 'none' Build type: 'distribution' The system cannot find the file specified. The system cannot find the file specified. ... [full log below]

The strange thing is the build will run through all the steps and even say the build succeeded, but when running in the browser it’s just a default non-content app.

build.lua

local params = { platform='html5', appName='browserInfo', appVersion='1.0', dstPath='C:\\Users\\develephant\\Documents\\Corona Projects\\htmlbuild', projectPath='C:\\Users\\develephant\\Documents\\Corona Projects', -- includeStandardResources=false, } return params

main.lua

print("Corona HTML5") display.newText({ text = "Corona HTML5", x = display.contentCenterX, y = 80, font = native.systemFont, fontSize = 36 })

Command line

C:\Users\develephant\>cd "%CORONA\_PATH%" C:\Program Files (x86)\Corona Labs\Corona\>Native\Corona\win\bin\CoronaBuilder.exe build --lua "C:\Users\develephant\Documents\Corona Projects\build.lua"

Build log

CoronaBuilder: building project with 'C:\Users\develephant\Documents\Corona Projects\build.lua' Current authorization is 'Corona' for user '\<my-email\>' Building app 'browserInfo' Version '1.0' Platform 'HTML5' PlatformVersion '-1' Project: 'C:\Users\develephant\Documents\Corona Projects' Dst: 'C:\Users\develephant\Documents\Corona Projects\htmlbuild' Custom build id: 'none' Build type: 'distribution' The system cannot find the file specified. The system cannot find the file specified. 7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Processing archive: C:\Program Files (x86)\Corona Labs\Corona\Resources\webtemplate.zip Extracting html Extracting html\emscripten.js Extracting html\emscripten.html Extracting html\emscripten-debug.html Extracting html\emscripten.html.mem Extracting res\_widget Extracting res\_widget\widget\_theme\_ios.png Extracting res\_widget\widget\_theme\_android\_holo\_dark@2x.png Extracting res\_widget\widget\_theme\_android\_holo\_dark.png Extracting res\_widget\widget\_theme\_ios7.png Extracting res\_widget\widget\_theme\_android\_holo\_dark@4x.png Extracting res\_widget\widget\_theme\_android\_holo\_light.png Extracting res\_widget\widget\_theme\_android\_holo\_light@2x.png Extracting res\_widget\widget\_theme\_android@2x.png Extracting res\_widget\widget\_theme\_ios7@4x.png Extracting res\_widget\widget\_theme\_onOff\_mask\_android\_holo.png Extracting res\_widget\widget\_theme\_android.png Extracting res\_widget\widget\_theme\_pickerWheel\_mask.png Extracting res\_widget\widget\_theme\_android\_holo\_light@4x.png Extracting res\_widget\widget\_theme\_ios@2x.png Extracting res\_widget\widget\_theme\_onOff\_mask.png Extracting res\_widget\widget\_theme\_ios7@2x.png Everything is Ok Folders: 2 Files: 20 Size: 7641316 Compressed: 2623856 ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows ------------------------------------------------------------------------------- Started : Wednesday, March 28, 2018 5:09:41 PM Source : C:\Users\develephant\Documents\Corona Projects\ Dest : C:\Users\DEVELE~1\AppData\Local\Temp\CoronaBuilder\_7524\CLtmpa05540\webapp\ Files : \*.\* Options : \*.\* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30 ------------------------------------------------------------------------------ 1 C:\Users\develephant\Documents\Corona Projects\ 100% New File 286 build.lua New Dir 10 C:\Users\develephant\Documents\Corona Projects\browserInfo\ 100% New File 940 build.settings 100% New File 352 config.lua 100% New File 834 Icon-hdpi.png 100% New File 400 Icon-ldpi.png 100% New File 504 Icon-mdpi.png 100% New File 1018 Icon-xhdpi.png 100% New File 1700 Icon-xxhdpi.png 100% New File 2258 Icon-xxxhdpi.png 100% New File 563 Icon.png 100% New File 170 main.lua New Dir 1 C:\Users\develephant\Documents\Corona Projects\browserInfo\Images.xcassets\ 100% New File 67 Contents.json New Dir 11 C:\Users\develephant\Documents\Corona Projects\browserInfo\Images.xcassets\AppIcon.appiconset\ 100% New File 2043 Contents.json 100% New File 23055 Icon-1024.png 100% New File 1860 Icon-120.png 100% New File 2531 Icon-152.png 100% New File 2639 Icon-167.png 100% New File 2966 Icon-180.png 100% New File 581 Icon-40.png 100% New File 859 Icon-58.png 100% New File 1190 Icon-76.png 100% New File 1261 Icon-80.png 100% New File 1424 Icon-87.png New Dir 4 C:\Users\develephant\Documents\Corona Projects\browserInfo\LaunchScreen.storyboardc\ 100% New File 1792 01J-lp-oVM-view-Ze5-6b-2t3.nib 100% New File 1872 designable.storyboard 100% New File 258 Info.plist 100% New File 832 UIViewController-01J-lp-oVM.nib New Dir 0 C:\Users\develephant\Documents\Corona Projects\htmlbuild\ New Dir 4 C:\Users\develephant\Documents\Corona Projects\htmlbuild\browserInfo\ 100% New File 730752 browserInfo.html.mem 100% New File 5.7 m browserInfo.js 100% New File 6911 index-debug.html 100% New File 4584 index.html ------------------------------------------------------------------------------ Total Copied Skipped Mismatch FAILED Extras Dirs : 7 6 1 0 0 0 Files : 31 31 0 0 0 0 Bytes : 6.52 m 6.52 m 0 0 0 0 Times : 0:00:00 0:00:00 0:00:00 0:00:00 Speed : 54314317 Bytes/sec. Speed : 3107.890 MegaBytes/min. Ended : Wednesday, March 28, 2018 5:09:41 PM ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows ------------------------------------------------------------------------------- Started : Wednesday, March 28, 2018 5:09:41 PM Source : C:\Users\DEVELE~1\AppData\Local\Temp\CoronaBuilder\_7524\CLtmpa05540\webtemplate\res\_widget\ Dest : C:\Users\DEVELE~1\AppData\Local\Temp\CoronaBuilder\_7524\CLtmpa05540\webapp\ Files : \*.\* Options : \*.\* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30 ------------------------------------------------------------------------------ 16 C:\Users\DEVELE~1\AppData\Local\Temp\CoronaBuilder\_7524\CLtmpa05540\webtemplate\res\_widget\ \*EXTRA Dir -1 C:\Users\DEVELE~1\AppData\Local\Temp\CoronaBuilder\_7524\CLtmpa05540\webapp\browserInfo\ \*EXTRA Dir -1 C:\Users\DEVELE~1\AppData\Local\Temp\CoronaBuilder\_7524\CLtmpa05540\webapp\htmlbuild\ \*EXTRA File 286 build.lua 100% New File 50131 widget\_theme\_android.png 100% New File 118927 widget\_theme\_android@2x.png 100% New File 19552 widget\_theme\_android\_holo\_dark.png 100% New File 44161 widget\_theme\_android\_holo\_dark@2x.png 100% New File 82090 widget\_theme\_android\_holo\_dark@4x.png 100% New File 20161 widget\_theme\_android\_holo\_light.png 100% New File 44277 widget\_theme\_android\_holo\_light@2x.png 100% New File 82343 widget\_theme\_android\_holo\_light@4x.png 100% New File 53098 widget\_theme\_ios.png 100% New File 16476 widget\_theme\_ios7.png 100% New File 45783 widget\_theme\_ios7@2x.png 100% New File 148641 widget\_theme\_ios7@4x.png 100% New File 123632 widget\_theme\_ios@2x.png 100% New File 1109 widget\_theme\_onOff\_mask.png 100% New File 166 widget\_theme\_onOff\_mask\_android\_holo.png 100% New File 1420 widget\_theme\_pickerWheel\_mask.png ------------------------------------------------------------------------------ Total Copied Skipped Mismatch FAILED Extras Dirs : 1 0 1 0 0 2 Files : 16 16 0 0 0 1 Bytes : 831.9 k 831.9 k 0 0 0 286 Times : 0:00:00 0:00:00 0:00:00 0:00:00 Speed : 13523285 Bytes/sec. Speed : 773.808 MegaBytes/min. Ended : Wednesday, March 28, 2018 5:09:41 PM data file contains (size / name) size = 940, /browserInfo/build.settings size = 834, /browserInfo/Icon-hdpi.png size = 400, /browserInfo/Icon-ldpi.png size = 504, /browserInfo/Icon-mdpi.png size = 1018, /browserInfo/Icon-xhdpi.png size = 1700, /browserInfo/Icon-xxhdpi.png size = 2258, /browserInfo/Icon-xxxhdpi.png size = 563, /browserInfo/Icon.png size = 2043, /browserInfo/Images.xcassets/AppIcon.appiconset/Contents.json size = 23055, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-1024.png size = 1860, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-120.png size = 2531, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-152.png size = 2639, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-167.png size = 2966, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-180.png size = 581, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-40.png size = 859, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-58.png size = 1190, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-76.png size = 1261, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-80.png size = 1424, /browserInfo/Images.xcassets/AppIcon.appiconset/Icon-87.png size = 67, /browserInfo/Images.xcassets/Contents.json size = 1792, /browserInfo/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib size = 1872, /browserInfo/LaunchScreen.storyboardc/designable.storyboard size = 258, /browserInfo/LaunchScreen.storyboardc/Info.plist size = 832, /browserInfo/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib size = 730752, /htmlbuild/browserInfo/browserInfo.html.mem size = 6047102, /htmlbuild/browserInfo/browserInfo.js size = 6911, /htmlbuild/browserInfo/index-debug.html size = 4584, /htmlbuild/browserInfo/index.html size = 956, /resource.car size = 50131, /widget\_theme\_android.png size = 118927, /widget\_theme\_android@2x.png size = 19552, /widget\_theme\_android\_holo\_dark.png size = 44161, /widget\_theme\_android\_holo\_dark@2x.png size = 82090, /widget\_theme\_android\_holo\_dark@4x.png size = 20161, /widget\_theme\_android\_holo\_light.png size = 44277, /widget\_theme\_android\_holo\_light@2x.png size = 82343, /widget\_theme\_android\_holo\_light@4x.png size = 53098, /widget\_theme\_ios.png size = 16476, /widget\_theme\_ios7.png size = 45783, /widget\_theme\_ios7@2x.png size = 148641, /widget\_theme\_ios7@4x.png size = 123632, /widget\_theme\_ios@2x.png size = 1109, /widget\_theme\_onOff\_mask.png size = 166, /widget\_theme\_onOff\_mask\_android\_holo.png size = 1420, /widget\_theme\_pickerWheel\_mask.png total data file size = 7695719 = 7515KB = 7MB Build succeeded [C:\Users\develephant\Documents\Corona Projects\htmlbuild]

Any clues as to what I am missing?

Thanks in advance,

-dev

Hi,

This is on build 3249 I should have mentioned.

-dev

We generally don’t recommend outputing a build to the project folder. Maybe that’s getting you.

Rob

Hi,

Thanks @Rob. I’ll play around a bit. What actually happens behind the scenes is the appName is appended to the paths so it ends up like…

 dstPath='C:\\Users\\develephant\\Documents\\Corona Projects\\htmlbuild\\\<appName\>', projectPath='C:\\Users\\develephant\\Documents\\Corona Projects\\\<appName\>'

…when the build runs. Not sure if that still coincides with what you are referring to?

-dev

That seems like it would be safe.

Rob

Hi,

Thanks @Rob. Hopefully @vlads will have something to say about it when he has a chance.

-dev

Hi,

Just to note, I did get this figured out. It appears I needed to put the app directory in the projectPath. Not sure why I thought otherwise.

EDIT: Still shows the “The system cannot find the file specified.” output though, but it appears to work in any case.

-dev

Hi guys, 

The Corona Builder looks really good. Where can I read more and download it?

Hi.

@Yoger Games - You can find more info in this thread.

https://forums.coronalabs.com/topic/72289-corona-html5-builder-cli-tool/

It’s specifically for HTML5 builds.

If you don’t want to use that tool, have a look at @vlads post above.

-dev

Let me move this to the HTML5 forum.

Rob

Hi,

I’ve handled it for now using an AppleScript, but still curious for cross platform usage.

-dev

This was brought up before, https://forums.coronalabs.com/topic/61405-scripting-build/. I am doing the same as you and using Automator but it is not an ideal solution. I really wanted it more for my Jenkins setup.

Would be nice to have something like this available to launch a simulator build from the command line. 

My thoughts was to be able to load the corona simulator from the terminal passing parameters to it:

 

For example:

 

/Applications/CoronaSDK/Corona Simulator.app -build Android -name “May App Name” -version “1.0” -package “com.mycompany.myapp” -keystore /path/to/my/keystore -keyalias “alias” -output /path/to/apk/output

 

Builds would still happen as they do now in the cloud. 

OK. With 3247 you can do something like this on macOS:

builder=~/Library/Application\ Support/Corona/Native/Corona/mac/bin/CoronaBuilder.app/Contents/MacOS/CoronaBuilder ${builder} build --lua build.lua&nbsp;

On Windows will work in 3248 (minor bug in 3247 breaks a build)

cd "%CORONA\_PATH%" Native\Corona\win\bin\CoronaBuilder.exe build --lua Z:\Projects\b2-win-html.lua

 
with contents of build.lua:

local params = { &nbsp; platform='html5', &nbsp; appName='2 Player Html', &nbsp; appVersion='1.0', &nbsp; dstPath='/Users/vlad/Projects/myCoolApp', &nbsp; projectPath='/Users/vlad/CoronaBuiltApps', &nbsp; -- includeStandardResources=false, } return params

And make sure to run Native/Setup Corona Native.app

Cheers!