Comments (13)
I don't know what is happening in my case though, it omits the root folder.
also I build without android studio using gradlew
in the build/android-native-build/projectname/
.\gradlew assembleDebugArm7
or
.\gradlew assembleReleaseArm7
from khamake.
var fs = require('fs');
let project = new Project('Alchemy');
//Assets
project.addAssets('Libraries/powerbracelet/Assets/**');
project.addAssets('Assets/**',{
nameBaseDir: 'Assets',
destination: '{dir}/{name}',
name: '{dir}/{name}'
});
//Sources
project.addSources('Sources');
//Shaders
project.addShaders('Libraries/alchemy/Shaders/**');
//Libraries
project.addLibrary('alchemy');
project.addLibrary('powerbracelet');
//project.addLibrary('zui');
project.addLibrary('korempt');
project.addLibrary('modplayer');
project.addLibrary('tweenxcore');
project.addLibrary('tweenx');
project.addLibrary('hxColorToolkit');
project.addLibrary('hxsignal');
// project.addLibrary('haxeui-core');
// project.addLibrary('haxeui-kha');
project.addLibrary('hscript');
project.targetOptions.android_native.screenOrientation = 'portrait';
project.windowOptions.width = 360;
project.windowOptions.height = 640;
//project.addDefine("arch_debug");
callbacks.postHaxeCompilation = addJsFiles;
resolve(project);
function addJsFiles(){
//-------------------------------------------------------------
// Include files
//-------------------------------------------------------------
var path = '';
if(platform === Platform.DebugHTML5){
path = './build/debug-html5/';
}
else if (platform === Platform.HTML5){
path = './build/html5/';
}
if(path !== '' && fs.existsSync(path) === false){
fs.mkdirSync(path);
}
if(path !== ''){
fs.createReadStream('./jsincludes/debug/index.html').pipe(fs.createWriteStream(path + 'index.html'));
fs.createReadStream('./jsincludes/chiptunejs/chiptune2.js').pipe(fs.createWriteStream(path + 'chiptune2.js'));
fs.createReadStream('./jsincludes/chiptunejs/libopenmpt.js').pipe(fs.createWriteStream(path + 'libopenmpt.js'));
fs.createReadStream('./jsincludes/chiptunejs/libopenmpt.js.mem').pipe(fs.createWriteStream(path + 'libopenmpt.js.mem'));
}
}
//-------------------------------------------------------------
// var shaderDefines = ['#define GLE_FRAGCOORD'];
// console.log(platform);
// if(platform === Platform.DebugHTML5){
// shaderDefines = ['#define GLE_FRAGCOORD'];
// }
// else{
// shaderDefines = [];
// }
// var fs = require('fs');
// fs.truncate('./Libraries/alchemy/Sources/ShaderIncludes/defines.glsl',0, function(e){});
// var file = fs.createWriteStream('./Libraries/alchemy/Sources/ShaderIncludes/defines.glsl');
// file.on('error', function(err) { console.log(err) });
// shaderDefines.forEach(function(v) { file.write(v + '\n'); });
// file.end();
//-------------------------------------------------------------
//-------------------------------------------------------------
this is the full khafile.js
from khamake.
I had to give an absolute path in my khafile.js to include a kore project, can you confirm if the path shown in the error is omitting a folder? Because that's the case for me.
edit
By your error it looks like it's including the folder twice.
from khamake.
The problem is that the khafile.js
in the project folder, /home/zicklag/programs/armory/ armory_examples/multitouch/
and it generates a Kore project with a korefile.js
in the build dir /home/zicklag/programs/armory/ armory_examples/multitouch/testbuild_2
. That korefile.js tries to include the subproject in android-native-hl-build
, but it fails because it appends the build dir, testbuild_2
, to the addProject
statement when it shouldn't. I'm going to try to write a PR to fix it.
BTW @RobDangerous I actually like the idea of not having to use Android Studio to compile the project, I just need a way to build the APK after the code is compiled.
from khamake.
Oh, nifty about gradlew. 👍
About your problem, do you have some logs from a run on your side? Or maybe the korefile.js that it creates in the build folder after running Khamake?
from khamake.
OK, I think I've fixed it. At least the problem that I had.
from khamake.
let fs = require('fs');
let path = require('path');
let project = new Project('Alchemy');
project.addDefine('HXCPP_API_LEVEL=332');
project.addDefine('HXCPP_DEBUG', 'Debug');
project.targetOptions = {"html5":{},"flash":{},"android":{"screenOrientation":"portrait"},"ios":{}};
project.setDebugDir('build/android-native');
await project.addProject('build/android-native-build');
await project.addProject('E:/Programming/haxe/Kha');
if (fs.existsSync(path.join('Libraries/alchemy', 'korefile.js'))) {
await project.addProject(path.join('..', 'Libraries/alchemy'));
}
if (fs.existsSync(path.join('Libraries/powerbracelet', 'korefile.js'))) {
await project.addProject(path.join('..', 'Libraries/powerbracelet'));
}
if (fs.existsSync(path.join('Libraries/korempt', 'korefile.js'))) {
await project.addProject(path.join('..', 'Libraries/korempt'));
}
if (fs.existsSync(path.join('Libraries/modplayer', 'korefile.js'))) {
await project.addProject(path.join('..', 'Libraries/modplayer'));
}
if (fs.existsSync(path.join('E:/Software/Haxe/lib/tweenxcore', 'korefile.js'))) {
await project.addProject('E:/Software/Haxe/lib/tweenxcore');
}
if (fs.existsSync(path.join('E:/Software/Haxe/lib/tweenx', 'korefile.js'))) {
await project.addProject('E:/Software/Haxe/lib/tweenx');
}
if (fs.existsSync(path.join('E:/Software/Haxe/lib/tweenxcore', 'korefile.js'))) {
await project.addProject('E:/Software/Haxe/lib/tweenxcore');
}
if (fs.existsSync(path.join('E:/Software/Haxe/lib/hxColorToolkit', 'korefile.js'))) {
await project.addProject('E:/Software/Haxe/lib/hxColorToolkit');
}
if (fs.existsSync(path.join('E:/Software/Haxe/lib/hxsignal', 'korefile.js'))) {
await project.addProject('E:/Software/Haxe/lib/hxsignal');
}
if (fs.existsSync(path.join('E:/Software/Haxe/lib/hscript', 'korefile.js'))) {
await project.addProject('E:/Software/Haxe/lib/hscript');
}
resolve(project);
It's the korempt one, so it seems fine but the error says:
Error: ENOENT: no such file or directory, open 'E:\Programming\haxe\Libraries\korempt\korefile.js'
between haxe
and Libraries
there should the project folder
from khamake.
OK, I think I see what you mean. Could you show your khafile.js? I'll try to reproduce this real quick, and I'll add a fix for this to my PR if I figure it out.
from khamake.
You are getting the error when you run Koremake right? Are you running Koremake from inside of the build dir?
from khamake.
No im calling khamake from the root folder.
from khamake.
Oh, and does Khamake start building the project immediately when you run it?
I'm able to run Khamake in my project folder which contains the khafile.js and it will put the build files in the ./build
directory. Then I move to the build directory and I run Koremake.
# From my project dir
$ node /home/zicklag/programs/armory/armsdk/Kha/make.js
Using Kha from /home/zicklag/programs/armory/armsdk/Kha
Creating Kha project.
Exporting asset 1 of 3 (Scene.arm).
...redacted...
Compiling shader 8 of 8 (painter-video.vert.glsl).
korefile found.
Creating Linux project files.
Done.
$ cd build
$ node /home/zicklag/programs/armory/armsdk/Kha/Kore/make.js --compile
korefile found.
Creating Linux project files.
Compiling shader 1 of 10 (g1.frag).
Compiling shader 2 of 10 (g1.vert).
...redacted...
from khamake.
It does some parts and then it cuts off with that error.
I can build my project by giving the absolute path though. I rather not move to the build folder.
from khamake.
OK, then that should be fine for now.
from khamake.
Related Issues (20)
- Chokidar ignore assets and shaders when the path contains a "." HOT 7
- [addProject] assets exported to wrong path
- [addProject] nested addProject calls don't seem to work
- Resource busy or locked HOT 5
- Source code not recompiled on change HOT 11
- project.addAssets with absolute path fails
- --haxe3 doesn't work with --watch HOT 3
- Automate kha_version define HOT 5
- Texture atlas generation HOT 9
- addAssets('../Assets/**') not including files HOT 3
- A library's addDefine gets ignored HOT 1
- Chokidar v3 request
- Shader compiler error writes to log.info() instead of log.error()?
- A library's full path is used for addDefine
- khafile.js -> await project.addProject("xyz") breaks code-completion (haxe doesn't build cache anymore) HOT 5
- CLI flag grep compat
- Should return non-success error code on compilation failure
- Store/query mapping from original asset filenames to renamed/converted asset filenames
- Khamake silently ignores khafile.js errors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from khamake.