Skip to content

Commit

Permalink
Make addProject work with Kinc-projects
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Apr 15, 2022
1 parent b8b1bf9 commit f8acc63
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 29 deletions.
2 changes: 2 additions & 0 deletions out/HaxeCompiler.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 23 additions & 15 deletions out/Project.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 22 additions & 14 deletions src/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,29 @@ export class Project {
if (!path.isAbsolute(projectDir)) {
projectDir = path.join(this.scriptdir, projectDir);
}
let project = await loadProject(projectDir, 'khafile.js', Project.platform);
this.assetMatchers = this.assetMatchers.concat(project.assetMatchers);
this.sources = this.sources.concat(project.sources);
this.shaderMatchers = this.shaderMatchers.concat(project.shaderMatchers);
this.defines = this.defines.concat(project.defines);
this.cdefines = this.cdefines.concat(project.cdefines);
this.cflags = this.cflags.concat(project.cflags);
this.cppflags = this.cppflags.concat(project.cppflags);
this.parameters = this.parameters.concat(project.parameters);
this.libraries = this.libraries.concat(project.libraries);
if (this.icon === null && project.icon !== null) this.icon = path.join(projectDir, project.icon);
for (let customTarget of project.customTargets.keys()) {
this.customTargets.set(customTarget, project.customTargets.get(customTarget));
if (!fs.existsSync(path.join(projectDir, 'khafile.js')) && (fs.existsSync(path.join(projectDir, 'kincfile.js')) || fs.existsSync(path.join(projectDir, 'korefile.js')) || fs.existsSync(path.join(projectDir, 'kfile.js')))) {
this.libraries.push({
libpath: projectDir,
libroot: projectDir
});
}
else {
let project = await loadProject(projectDir, 'khafile.js', Project.platform);
this.assetMatchers = this.assetMatchers.concat(project.assetMatchers);
this.sources = this.sources.concat(project.sources);
this.shaderMatchers = this.shaderMatchers.concat(project.shaderMatchers);
this.defines = this.defines.concat(project.defines);
this.cdefines = this.cdefines.concat(project.cdefines);
this.cflags = this.cflags.concat(project.cflags);
this.cppflags = this.cppflags.concat(project.cppflags);
this.parameters = this.parameters.concat(project.parameters);
this.libraries = this.libraries.concat(project.libraries);
if (this.icon === null && project.icon !== null) this.icon = path.join(projectDir, project.icon);
for (let customTarget of project.customTargets.keys()) {
this.customTargets.set(customTarget, project.customTargets.get(customTarget));
}
// windowOptions and targetOptions are ignored
}
// windowOptions and targetOptions are ignored
}

private unglob(str: string): string {
Expand Down

0 comments on commit f8acc63

Please sign in to comment.