-
-
Notifications
You must be signed in to change notification settings - Fork 119
kfile.js
Kinc uses a javascript file called kfile.js
where you configure your project. A basic kfile.js
looks like this:
var project = new Project('ProjectName');
await project.addProject('Kinc');
project.addFile('Sources/**');
project.setDebugDir('Deployment');
project.flatten();
resolve(project);
This sets the Source folders and the Deployment folder, and uses the default configuration for other options. The DebugDir specified will contain the compiled Shader files if ever you had any in the folder specified by addFile.
Add the icon.png
file to the root project directory to use it as a new icon. The desired resolution is 512x512 or 1024x1024 for high-dpi monitors. You can also set custom path:
project.icon = 'path/icon.png';
project.addFile('Sources/**');
You can use multiple source folders, including external folders.
project.addIncludeDir('include');
project.addLib('libv8_monolith.a');
await project.addProject(pathToProject);
kmake can integrate other Kinc projects, it will parse their kfiles and include all sources and shaders. Be aware that addProject
is asynchronous - use await to synchronize execution.
project.addFiles('Sources/Shaders/**');
project.cStd = 'c11';
project.cppStd = 'c++17';
project.addDefine('SOME_DEFINE=1');
alternatively flags for c or cpp can be added like so:
project.addCFlag('SOME_DEFINE=1');
project.addCppFlag('KINCY_STUFF=1');
const android = project.targetOptions.android;
android.package = 'com.example.app';
android.versionCode = 1;
android.versionName = '1.0';
// https://developer.android.com/guide/topics/manifest/activity-element.html#screen
android.screenOrientation = 'portrait';
android.permissions = ['android.permission.VIBRATE'];
// https://developer.android.com/guide/topics/manifest/manifest-element#install
android.installLocation = "internalOnly";
// https://developer.android.com/guide/topics/manifest/meta-data-element
android.metadata = [];
// same as <meta-data android:name="disableStickyImmersiveMode" android:value="true"/>
android.disableStickyImmersiveMode = true;
android.globalBuildGradlePath = 'data/android/build.gradle';
android.buildGradlePath = 'data/android/app/build.gradle';
android.proguardRulesPath = 'data/android/app/proguard-rules.pro';
// for files in Android Studio project-level dir
android.customFilesPath = 'data/android/files';
project.targetOptions.ios.bundle = 'com.example.$(PRODUCT_NAME:rfc1034identifier)';
project.targetOptions.ios.organizationName = 'Your Awesome Organization';
project.targetOptions.ios.developmentTeam = 'XXXXXXXXXX';
project.targetOptions.ios.version = '1.0';
project.targetOptions.ios.build = '1';
(to find your development team ID, visit https://developer.apple.com/account/#/membership and use the alphanumeric code under Team ID)
project.addDefine('KINC_NO_WAYLAND'); // to force not using Wayland
project.addDefine('KINC_WAYLAND_APP_ID="my-custom-app-id"'); // Override the default app-id