added readme and example

This commit is contained in:
2018-04-25 22:04:09 +03:00
parent 373ee7703d
commit cb405efd26
10 changed files with 261 additions and 5 deletions

52
example/gulpfile.js Normal file
View File

@@ -0,0 +1,52 @@
const gulp = require('gulp');
const gulpClean = require('gulp-clean');
const packageInfo = require('./package.json');
const {Sdk, Haxe, Project} = require('gulp-haxetool');
//Sdk.dir = '/opt/sdk';
exports.clean = function clean() {
return gulp.src('target/*', {read: false}).pipe(gulpClean());
};
exports.install = function install() {
const haxe = new Haxe();
return haxe.prepare().then(() => haxe.install(packageInfo.haxeDependencies));
};
const config = new Project.Config({
meta: {
title: 'Application',
filename: 'app',
icon: './resources/icon.jpg',
pack: 'com.example',
author: 'Anonim <anonim@anonim.com>',
company: 'Any company',
version: packageInfo.version,
},
name: 'app',
libs: packageInfo.haxeDependencies,
sources: ['src'],
assets: ['resources'],
main: 'Main',
});
const project = new Project(
Project.BuildSystem.OPENFL,
[
Project.Platform.FLASH,
Project.Platform.HTML5,
Project.Platform.LINUX,
],
config
).bind(module, gulp);
module.exports.default = gulp.series(
exports.clean,
exports.install,
module.exports['app:flash:build'],
module.exports['app:html5:build'],
module.exports['app:linux:build'],
module.exports['app:flash:pack'],
module.exports['app:linux:pack'],
);