Auxiliary build/release scripts ported.
This commit is contained in:
parent
82cdcf61a0
commit
14e020e67a
6 changed files with 46 additions and 43 deletions
|
@ -2,16 +2,9 @@
|
||||||
# @author Stefan Wilhelm (wile)
|
# @author Stefan Wilhelm (wile)
|
||||||
# @license MIT
|
# @license MIT
|
||||||
#
|
#
|
||||||
# GNU Make makefile for, well, speeding
|
# GNU Make makefile based build relay.
|
||||||
# up the development a bit.
|
# Note for reviewers/clones: This file is a auxiliary script for my setup.
|
||||||
# You very likely need some tools installed
|
# It's not needed to build the mod.
|
||||||
# to use all build targets, so this file is
|
|
||||||
# not "official". If you work on windows and
|
|
||||||
# install GIT with complete shell PATH (the
|
|
||||||
# red marked option in the GIT installer) you
|
|
||||||
# should have the needed unix tools available.
|
|
||||||
# For image stripping install imagemagick and
|
|
||||||
# also put the "magick" executable in the PATH.
|
|
||||||
#
|
#
|
||||||
MOD_JAR_PREFIX=engineersdecor-
|
MOD_JAR_PREFIX=engineersdecor-
|
||||||
MOD_JAR=$(filter-out %-sources.jar,$(wildcard build/libs/${MOD_JAR_PREFIX}*.jar))
|
MOD_JAR=$(filter-out %-sources.jar,$(wildcard build/libs/${MOD_JAR_PREFIX}*.jar))
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/djs
|
#!/usr/bin/djs
|
||||||
|
// Note for reviewers/clones: This file is a auxiliary script for my setup. It's not needed to build the mod.
|
||||||
"use strict";
|
"use strict";
|
||||||
if(!fs.chdir(fs.dirname(fs.realpath(sys.script)))) throw new Error("Failed to switch to mod source directory.");
|
if(!fs.chdir(fs.dirname(fs.realpath(sys.script)))) throw new Error("Failed to switch to mod source directory.");
|
||||||
if(!fs.isdir("../.git")) throw new Error("Missing git repository in parent directory of mod source.");
|
if(!fs.isdir("../.git")) throw new Error("Missing git repository in parent directory of mod source.");
|
||||||
|
|
|
@ -2,16 +2,9 @@
|
||||||
# @author Stefan Wilhelm (wile)
|
# @author Stefan Wilhelm (wile)
|
||||||
# @license MIT
|
# @license MIT
|
||||||
#
|
#
|
||||||
# GNU Make makefile for, well, speeding
|
# GNU Make makefile based build relay.
|
||||||
# up the development a bit.
|
# Note for reviewers/clones: This file is a auxiliary script for my setup.
|
||||||
# You very likely need some tools installed
|
# It's not needed to build the mod.
|
||||||
# to use all build targets, so this file is
|
|
||||||
# not "official". If you work on windows and
|
|
||||||
# install GIT with complete shell PATH (the
|
|
||||||
# red marked option in the GIT installer) you
|
|
||||||
# should have the needed unix tools available.
|
|
||||||
# For image stripping install imagemagick and
|
|
||||||
# also put the "magick" executable in the PATH.
|
|
||||||
#
|
#
|
||||||
MOD_JAR_PREFIX=engineersdecor-
|
MOD_JAR_PREFIX=engineersdecor-
|
||||||
MOD_JAR=$(filter-out %-sources.jar,$(wildcard build/libs/${MOD_JAR_PREFIX}*.jar))
|
MOD_JAR=$(filter-out %-sources.jar,$(wildcard build/libs/${MOD_JAR_PREFIX}*.jar))
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/djs
|
#!/usr/bin/djs
|
||||||
|
// Note for reviewers/clones: This file is a auxiliary script for my setup. It's not needed to build the mod.
|
||||||
"use strict";
|
"use strict";
|
||||||
if(!fs.chdir(fs.dirname(fs.realpath(sys.script)))) throw new Error("Failed to switch to mod source directory.");
|
if(!fs.chdir(fs.dirname(fs.realpath(sys.script)))) throw new Error("Failed to switch to mod source directory.");
|
||||||
if(!fs.isdir("../.git")) throw new Error("Missing git repository in parent directory of mod source.");
|
if(!fs.isdir("../.git")) throw new Error("Missing git repository in parent directory of mod source.");
|
||||||
|
|
13
Makefile
13
Makefile
|
@ -2,16 +2,9 @@
|
||||||
# @author Stefan Wilhelm (wile)
|
# @author Stefan Wilhelm (wile)
|
||||||
# @license MIT
|
# @license MIT
|
||||||
#
|
#
|
||||||
# GNU Make makefile for, well, speeding
|
# GNU Make makefile based build relay.
|
||||||
# up the development a bit.
|
# Note for reviewers/clones: This file is a auxiliary script for my setup.
|
||||||
# You very likely need some tools installed
|
# It's not needed to build the mod.
|
||||||
# to use all build targets, so this file is
|
|
||||||
# not "official". If you work on windows and
|
|
||||||
# install GIT with complete shell PATH (the
|
|
||||||
# red marked option in the GIT installer) you
|
|
||||||
# should have the needed unix tools available.
|
|
||||||
# For image stripping install imagemagick and
|
|
||||||
# also put the "magick" executable in the PATH.
|
|
||||||
#
|
#
|
||||||
.PHONY: default init clean clean-all dist sync-main-repo sanatize update-json
|
.PHONY: default init clean clean-all dist sync-main-repo sanatize update-json
|
||||||
.PHONY: init-1.12 clean-1.12 clean-all-1.12 dist-1.12 sanatize-1.12
|
.PHONY: init-1.12 clean-1.12 clean-all-1.12 dist-1.12 sanatize-1.12
|
||||||
|
|
48
tasks.js
48
tasks.js
|
@ -1,5 +1,7 @@
|
||||||
|
#!/usr/bin/djs
|
||||||
"use strict";
|
"use strict";
|
||||||
const main_repo_local = fs.realpath("../engineersdecor-github");
|
// Note for reviewers/clones: This file is a auxiliary script for my setup. It's not needed to build the mod.
|
||||||
|
const config_main_repo = fs.realpath("../engineersdecor-github");
|
||||||
if(!fs.chdir(fs.dirname(fs.realpath(sys.script)))) throw new Error("Failed to switch to mod repository base directory.");
|
if(!fs.chdir(fs.dirname(fs.realpath(sys.script)))) throw new Error("Failed to switch to mod repository base directory.");
|
||||||
if(!fs.isdir(".git")) throw new Error("Missing git repository in mod repository base directory.");
|
if(!fs.isdir(".git")) throw new Error("Missing git repository in mod repository base directory.");
|
||||||
var tasks = {};
|
var tasks = {};
|
||||||
|
@ -26,19 +28,39 @@ tasks["update-json"] = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
tasks["sync-main-repository"] = function() {
|
tasks["sync-main-repository"] = function() {
|
||||||
if((!fs.chdir(fs.dirname(fs.realpath(sys.script))+"/..")) || (!fs.isdir(".git"))) throw new Error("Failed to switch to mod source directory.");
|
// step-by-step-verbose operations, as the code bases and copy data are different.
|
||||||
const test_repo_local = fs.cwd();
|
if((!fs.chdir(fs.dirname(fs.realpath(sys.script)))) || (!fs.isdir(".git"))) throw new Error("Failed to switch to mod source directory.");
|
||||||
|
if(sys.shell("git remote -v") != "") throw new Error("Dev repository has a remote set.");
|
||||||
if(main_repo_local == "") throw new Error("Main repository (real) path not found.");
|
if(main_repo_local == "") throw new Error("Main repository (real) path not found.");
|
||||||
if(fs.realpath(main_repo_local) == fs.realpath(test_repo_local)) throw new Error("This is already the main repository");
|
const test_repo_local = fs.cwd();
|
||||||
if((!fs.chdir(main_repo_local)) || (!fs.isdir(".git"))) throw new Error("Failed to switch to main repository directory.");
|
const main_repo_local = fs.realpath(config_main_repo);
|
||||||
if(fs.cwd().search("-github") < 0) throw new Error("Main repository is missing the '*-github' tag in the path name.");
|
if(main_repo_local == fs.realpath(test_repo_local)) throw new Error("This is already the main repository");
|
||||||
// sys.shell("rm -rf build documentation gradle meta scripts src")
|
const cd_dev = function(subdir) {
|
||||||
// sys.shell("rm -f .gitignore build.gradle gradle.properties gradlew gradlew.bat license Makefile readme.md")
|
if((!fs.chdir(test_repo_local)) || (!fs.isdir(".git"))) throw new Error("Failed to switch to mod source directory.");
|
||||||
// if((!fs.chdir(test_repo_local)) || (!fs.isdir(".git"))) throw new Error("Failed to switch to local dev directory.");
|
if((subdir!==undefined) && (!fs.chdir(subdir))) throw new Error("Failed to change to '" + subdir + "' of the test repository.");
|
||||||
// sys.shell("cp -r documentation gradle meta scripts src " + main_repo_local + "/")
|
}
|
||||||
// sys.shell("cp .gitignore build.gradle gradle.properties gradlew gradlew.bat license Makefile readme.md " + main_repo_local + "/")
|
const cd_main = function(subdir) {
|
||||||
// if((!fs.chdir(main_repo_local)) || (!fs.isdir(".git"))) throw new Error("Failed to switch to main repository directory.");
|
if((!fs.chdir(main_repo_local)) || (!fs.isdir(".git"))) throw new Error("Failed to switch to main repository directory.");
|
||||||
// print(sys.shell("git status -s"))
|
if(fs.cwd().search("-github") < 0) throw new Error("Main repository is missing the '*-github' tag in the path name.");
|
||||||
|
if((subdir!==undefined) && (!fs.chdir(subdir))) throw new Error("Failed to change to '" + subdir + "' of the main repository.");
|
||||||
|
};
|
||||||
|
cd_main();
|
||||||
|
sys.shell("rm -rf documentation meta");
|
||||||
|
sys.shell("rm -f .gitignore credits.md license Makefile readme.md tasks.js");
|
||||||
|
cd_main("1.12"); sys.shell("rm -rf meta src gradle");
|
||||||
|
cd_main("1.13"); sys.shell("rm -rf meta src gradle");
|
||||||
|
cd_dev();
|
||||||
|
sys.shell("cp -f .gitignore credits.md license Makefile readme.md tasks.js \"" + main_repo_local + "/\"")
|
||||||
|
sys.shell("cp -r documentation meta \"" + main_repo_local + "/\"")
|
||||||
|
cd_dev("1.12");
|
||||||
|
sys.shell("cp -f build.gradle gradle.properties gradlew gradlew.bat Makefile readme.md tasks.js signing.* \"" + main_repo_local + "/1.12/\"")
|
||||||
|
sys.shell("cp -r src gradle meta \"" + main_repo_local + "/1.12/\"")
|
||||||
|
cd_dev("1.13");
|
||||||
|
sys.shell("cp -f build.gradle gradle.properties gradlew gradlew.bat Makefile readme.md tasks.js signing.* \"" + main_repo_local + "/1.13/\"")
|
||||||
|
sys.shell("cp -r src gradle meta \"" + main_repo_local + "/1.13/\"")
|
||||||
|
cd_main();
|
||||||
|
print("Main repository changes:");
|
||||||
|
print(sys.shell("git status -s"))
|
||||||
};
|
};
|
||||||
|
|
||||||
const task_name = sys.args[0];
|
const task_name = sys.args[0];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue