Skip to content

Commit

Permalink
added neko script build_output.n which installs it as a local haxelib…
Browse files Browse the repository at this point in the history
… library. Make sure the directory bin exists. Not a perfect build tool.

example : neko build_output.n build

Then use -D titaniumdesktop in your libraries.
  • Loading branch information
skial committed Jul 13, 2011
1 parent 8537146 commit a8acebe
Show file tree
Hide file tree
Showing 55 changed files with 173 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .gitignore
@@ -0,0 +1,42 @@
.paths
.hxproj

# from html5 boilerplate - http://html5boilerplate.com/
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~

# OS or Editor folders
.DS_Store
.cache
.project
.settings
nbproject
thumbs.db

# Dreamweaver added files
_notes
dwsync.xml

# Komodo
*.komodoproject
.komodotools

# Folders to ignore
.hg
.svn
publish
.idea

# build script local files
build/buildinfo.properties
build/config/buildinfo.properties

bin/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added build_output.n
Binary file not shown.
93 changes: 93 additions & 0 deletions builder/Build.hx
@@ -0,0 +1,93 @@
package ;

/**
* ...
* @author Skial Bainn
*/

import massive.neko.cmd.Command;
import massive.neko.io.FileSys;
import massive.neko.io.File;
import massive.neko.haxelib.Haxelib;
import massive.neko.haxelib.HaxelibTools;
import massive.neko.util.ZipUtil;
import neko.Sys;

using Arrays;

class Build extends Command {

public static var IGNORE:Array<String> = ['builder', 'bin', 'src', '.hg', '.git', 'build_output.n', 'changes.txt', 'readme.txt', 'haXe-titanium desktop.hxproj', '.gitignore', 'example', 'compile.hxml', 'README', 'Main.hx'];
public static var OUTPUT:String = FileSys.getCwd() + 'bin' + File.seperator + 'titaniumdesktop';

public function new() {
super();
}

override public function initialise():Void {

}

override public function execute():Void {

this.print('working');

if (!FileSys.exists(OUTPUT)) {

this.print('/bin/titaniumdesktop does not exist - creating output directory');
FileSys.createDirectory(OUTPUT);

}

var out:File = File.create(OUTPUT);
var file:File;

for (n in FileSys.readDirectory(FileSys.getCwd())) {

if (!IGNORE.exists(n)) {

//this.print('now copying directory ' + n + ' contents into ' + OUTPUT);

for (m in FileSys.readDirectory(FileSys.getCwd() + n + File.seperator)) {

file = File.create(FileSys.getCwd() + n + File.seperator + m);
file.copyInto(out, true);

}

}

}

this.print('creating haxelib.xml');

try {
FileSys.deleteFile(OUTPUT + File.seperator + 'haxelib.xml');
} catch (e:Dynamic) {

}

var haxelib = new Haxelib(File.create(OUTPUT + File.seperator + 'haxelib.xml'));
haxelib.name = 'titaniumdesktop';
haxelib.url = 'https://github.com/skial/haXe-titanium-desktop';
haxelib.user = 'skial';
haxelib.license = 'BSD';
haxelib.description = 'haXe extern classes for http://www.appcelerator.com/ titanium desktop library.';
haxelib.version = '0.0.0.0';
haxelib.versionDescription = 'local test';
haxelib.save();

this.print('creating titaniumdesktop.zip');

var zip = File.create(OUTPUT + File.seperator + '..' + File.seperator + 'titaniumdesktop.zip');
ZipUtil.zipDirectory(zip, out);

if(neko.Sys.command("haxelib test " + '"' + zip + '"') > 0) {
this.print("This might have failed to install " + zip + " to haxelib. Please check");
}

this.print('all done!');

}

}
26 changes: 26 additions & 0 deletions builder/Main.hx
@@ -0,0 +1,26 @@
package ;

/**
* ...
* @author Skial Bainn
*/

import massive.neko.cmd.CommandLineRunner;

class Main extends CommandLineRunner {

public static function main() {
var m = new Main();
}

public function new() {

super();

this.mapCommand(Build, 'build', ['b'], 'copies all folders into one output folder');

this.run();

}

}
5 changes: 5 additions & 0 deletions builder/compile.hxml
@@ -0,0 +1,5 @@
-neko ../build_output.n
-main Main
-cp ./
-lib mlib
-lib thx
10 changes: 7 additions & 3 deletions haXe-titanium desktop.hxproj
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<project version="2">
<!-- Output SWF options -->
<output>
<movie disabled="False" />
<movie outputType="Application" />
<movie input="" />
<movie path="example\haxe-titanium test\Resources\haXetitaniumdesktop.js" />
<movie fps="0" />
<movie width="0" />
<movie height="0" />
<movie version="11" />
<movie version="0" />
<movie minorVersion="0" />
<movie platform="JavaScript" />
<movie background="#FFFFFF" />
</output>
<!-- Other classes to be compiled into your SWF -->
Expand Down Expand Up @@ -45,4 +47,6 @@
<option testMovie="OpenDocument" />
<option testMovieCommand="" />
</options>
<!-- Plugin storage -->
<storage />
</project>

0 comments on commit a8acebe

Please sign in to comment.