Giter Club home page Giter Club logo

Comments (13)

Disar avatar Disar commented on July 30, 2024 1

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.

Disar avatar Disar commented on July 30, 2024 1
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.

Disar avatar Disar commented on July 30, 2024

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.

zicklag avatar zicklag commented on July 30, 2024

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.

zicklag avatar zicklag commented on July 30, 2024

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.

zicklag avatar zicklag commented on July 30, 2024

OK, I think I've fixed it. At least the problem that I had.

from khamake.

Disar avatar Disar commented on July 30, 2024
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.

zicklag avatar zicklag commented on July 30, 2024

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.

zicklag avatar zicklag commented on July 30, 2024

You are getting the error when you run Koremake right? Are you running Koremake from inside of the build dir?

from khamake.

Disar avatar Disar commented on July 30, 2024

No im calling khamake from the root folder.

from khamake.

zicklag avatar zicklag commented on July 30, 2024

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.

Disar avatar Disar commented on July 30, 2024

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.

zicklag avatar zicklag commented on July 30, 2024

OK, then that should be fine for now.

from khamake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.