Skip to content

Commit bd4bc16

Browse files
committed
Add some basic samples and build them
1 parent 2ae1b56 commit bd4bc16

File tree

8 files changed

+120
-1
lines changed

8 files changed

+120
-1
lines changed

.github/workflows/main.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,42 @@ jobs:
2424
package.json
2525
README.md
2626
run.n
27-
if-no-files-found: error
27+
if-no-files-found: error
28+
29+
samples:
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.2]
34+
steps:
35+
36+
- uses: actions/checkout@v4
37+
38+
- uses: krdlab/setup-haxe@v1
39+
with:
40+
haxe-version: ${{ matrix.haxe-version }}
41+
42+
- name: Set HAXEPATH
43+
run: |
44+
echo "HAXEPATH=$HAXE_STD_PATH/.." >> $GITHUB_ENV
45+
46+
- name: Install Haxe dependencies
47+
run: |
48+
haxelib install lime --quiet
49+
haxelib install openfl --quiet
50+
haxelib dev hxp ${{ github.workspace }}
51+
52+
- name: Build HxpHxmlSample sample
53+
working-directory: samples/HxpHxmlSample
54+
run: |
55+
haxelib run hxp build
56+
57+
- name: Build HxpLimeSample sample
58+
working-directory: samples/HxpLimeSample
59+
run: |
60+
haxelib run lime build neko
61+
62+
- name: Build HxpOpenFLSample sample
63+
working-directory: samples/HxpOpenFLSample
64+
run: |
65+
haxelib run lime build neko

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ package-lock.json
1515
node_modules
1616
!bin/**/node_modules
1717
.vscode/
18+
bin/

samples/HxpHxmlSample/build.hxp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import hxp.*;
2+
import lime.tools.*;
3+
4+
class Build {
5+
public function new() {
6+
7+
var hxml = new HXML({
8+
cp: ["src"],
9+
main: "Main",
10+
js: "bin/index.js"
11+
});
12+
hxml.build();
13+
14+
}
15+
16+
}

samples/HxpHxmlSample/src/Main.hx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Main
2+
{
3+
public static function main():Void
4+
{
5+
trace("Made with HXP");
6+
}
7+
}

samples/HxpLimeSample/Project.hxp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import hxp.*;
2+
import lime.tools.*;
3+
4+
class Project extends HXProject {
5+
public function new() {
6+
super();
7+
8+
app.main = "Main";
9+
app.path = "Export";
10+
meta.title = "Lime with HXP";
11+
haxelibs.push(new Haxelib("lime"));
12+
sources.push("Source");
13+
14+
}
15+
16+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import lime.app.Application;
2+
3+
class Main extends Application
4+
{
5+
public function new()
6+
{
7+
super();
8+
9+
trace("Made with HXP");
10+
}
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import hxp.*;
2+
import lime.tools.*;
3+
4+
class Project extends HXProject {
5+
public function new() {
6+
super();
7+
8+
app.main = "Main";
9+
app.path = "Export";
10+
meta.title = "OpenFL with HXP";
11+
haxelibs.push(new Haxelib("openfl"));
12+
sources.push("Source");
13+
14+
}
15+
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import openfl.display.Sprite;
2+
import openfl.text.TextField;
3+
4+
class Main extends Sprite
5+
{
6+
public function new()
7+
{
8+
super();
9+
10+
var tf = new TextField();
11+
tf.text = "Made with HXP";
12+
addChild(tf);
13+
}
14+
}

0 commit comments

Comments
 (0)