diff --git a/Earthfile b/Earthfile index 33eaa695..fe7ee78a 100644 --- a/Earthfile +++ b/Earthfile @@ -205,10 +205,19 @@ run.n: COPY .git .git COPY src src COPY hx3compat hx3compat - COPY client.hxml haxelib.json . + COPY client.hxml each.hxml haxelib.json . RUN haxe client.hxml SAVE ARTIFACT run.n AS LOCAL run.n +haxelib-binary: + FROM +devcontainer + COPY .git .git + COPY src src + COPY hx3compat hx3compat + COPY client_cpp.hxml each.hxml haxelib.json . + RUN haxe client_cpp.hxml + SAVE ARTIFACT haxelib AS LOCAL haxelib + package-haxelib: FROM +devcontainer-base COPY src src @@ -350,7 +359,7 @@ haxelib-server-builder: haxelib-server-legacy: FROM +haxelib-server-builder - COPY server_legacy.hxml server_each.hxml . + COPY server_legacy.hxml server_each.hxml each.hxml . COPY src src COPY hx3compat hx3compat COPY www/legacy www/legacy @@ -359,7 +368,7 @@ haxelib-server-legacy: haxelib-server-website: FROM +haxelib-server-builder - COPY server_website.hxml server_each.hxml . + COPY server_website.hxml server_each.hxml each.hxml . COPY src src COPY hx3compat hx3compat RUN haxe server_website.hxml @@ -373,7 +382,7 @@ haxelib-server-website-highlighter: haxelib-server-tasks: FROM +haxelib-server-builder - COPY server_tasks.hxml server_each.hxml . + COPY server_tasks.hxml server_each.hxml each.hxml . COPY src src COPY hx3compat hx3compat RUN haxe server_tasks.hxml @@ -381,7 +390,7 @@ haxelib-server-tasks: haxelib-server-api: FROM +haxelib-server-builder - COPY server_api.hxml server_each.hxml . + COPY server_api.hxml server_each.hxml each.hxml . COPY src src COPY hx3compat hx3compat RUN haxe server_api.hxml @@ -518,6 +527,7 @@ ci-tests: # for package.hxml COPY haxelib.json README.md . COPY +run.n/run.n . + COPY +haxelib-binary/haxelib . COPY +ci-runner/ci.n bin/ci.n ENV HAXELIB_SERVER=localhost diff --git a/client.hxml b/client.hxml index e5a3ae3c..8339bdfd 100644 --- a/client.hxml +++ b/client.hxml @@ -1,6 +1,3 @@ --cp src --cp hx3compat/std --cp hx4compat/std --cp crypto/src +each.hxml -neko run.n -main haxelib.client.Main diff --git a/client_cpp.hxml b/client_cpp.hxml new file mode 100644 index 00000000..0873c881 --- /dev/null +++ b/client_cpp.hxml @@ -0,0 +1,6 @@ +each.hxml +--cpp bin/cpp +--main haxelib.client.Main +-D destination=../../haxelib{EXESUFFIX} +--dce full +-D analyzer-optimize diff --git a/client_legacy.hxml b/client_legacy.hxml index b35394fe..cea40579 100644 --- a/client_legacy.hxml +++ b/client_legacy.hxml @@ -1,6 +1,3 @@ --cp src --cp hx3compat/std --cp hx4compat/std --cp crypto/src +each.hxml -neko bin/legacyhaxelib.n -main legacyhaxelib.Main \ No newline at end of file diff --git a/client_tests.hxml b/client_tests.hxml index 38c61023..63d96aba 100644 --- a/client_tests.hxml +++ b/client_tests.hxml @@ -1,8 +1,5 @@ --p src +each.hxml -p test --p hx3compat/std --p hx4compat/std --p crypto/src --main HaxelibTests --debug --neko bin/test.n diff --git a/each.hxml b/each.hxml new file mode 100644 index 00000000..1442fc5a --- /dev/null +++ b/each.hxml @@ -0,0 +1,4 @@ +-cp src +-cp hx3compat/std +-cp hx4compat/std +-cp crypto/src diff --git a/integration_tests.hxml b/integration_tests.hxml index 37ab3b6e..418ac931 100644 --- a/integration_tests.hxml +++ b/integration_tests.hxml @@ -1,7 +1,4 @@ --cp src --cp test --lib hx3compat --cp hx4compat/std --cp crypto/src +each.hxml +-p test -main IntegrationTests -neko bin/integration_tests.n \ No newline at end of file diff --git a/libs.hxml b/libs.hxml index ef9ca5b3..02cf8bac 100644 --- a/libs.hxml +++ b/libs.hxml @@ -29,4 +29,5 @@ -cmd curl -sSLk https://lib.haxe.org/files/3.0/ufront-2,0,0.zip -o haxelib_global/ufront.zip && neko run.n install --always --skip-dependencies haxelib_global/ufront.zip -cmd curl -sSLk https://lib.haxe.org/files/3.0/utest-1,9,6.zip -o haxelib_global/utest.zip && neko run.n install --always --skip-dependencies haxelib_global/utest.zip -cmd curl -sSLk https://lib.haxe.org/files/3.0/hxnodejs-12,1,0.zip -o haxelib_global/hxnodejs.zip && neko run.n install --always --skip-dependencies haxelib_global/hxnodejs.zip +-cmd curl -sSLk https://lib.haxe.org/files/3.0/hxcpp-4,3,2.zip -o haxelib_global/hxcpp.zip && neko run.n install --always --skip-dependencies haxelib_global/hxcpp.zip -cmd neko run.n dev record-macros lib/record-macros diff --git a/package.hxml b/package.hxml index 0531ad3e..1449485c 100755 --- a/package.hxml +++ b/package.hxml @@ -1,5 +1,2 @@ --cp src --cp hx3compat/std --cp hx4compat/std --cp crypto/src +-p src --run Package \ No newline at end of file diff --git a/server_each.hxml b/server_each.hxml index aac31546..329e27b7 100644 --- a/server_each.hxml +++ b/server_each.hxml @@ -1,7 +1,4 @@ --cp src --cp hx3compat/std --cp hx4compat/std --cp crypto/src +each.hxml -lib ufront -lib ufront-mail:1.0.0-rc.4 -lib ufront-ufadmin diff --git a/server_gitrepo.hxml b/server_gitrepo.hxml index 8a93ca92..b3276ec0 100644 --- a/server_gitrepo.hxml +++ b/server_gitrepo.hxml @@ -1,9 +1,6 @@ ---class-path src +each.hxml --class-path lib/dts2hx-generated --class-path lib/node-sys-db ---class-path hx3compat/std ---class-path hx4compat/std ---class-path crypto/src --library hxnodejs --library record-macros --js gitrepo.js diff --git a/server_legacy.hxml b/server_legacy.hxml index 3e559317..f522ee63 100644 --- a/server_legacy.hxml +++ b/server_legacy.hxml @@ -1,5 +1,4 @@ server_each.hxml --cp src -neko www/legacy/index.n -main legacyhaxelib.Site -lib hx2compat diff --git a/src/Package.hx b/src/Package.hx index d5ddc229..bf843520 100644 --- a/src/Package.hx +++ b/src/Package.hx @@ -5,7 +5,6 @@ import haxe.zip.Tools; import sys.io.File; import sys.FileSystem; -import haxelib.client.Main.VERSION; import haxelib.Data.Infos; using StringTools; diff --git a/src/haxelib/client/Main.hx b/src/haxelib/client/Main.hx index fc438511..eb943a8a 100644 --- a/src/haxelib/client/Main.hx +++ b/src/haxelib/client/Main.hx @@ -214,7 +214,7 @@ class Main { Version => create(version, 0), Help => create(usage, 0), - #if neko + #if !js Submit => create(submit, 3, true), #end Register => create(register, 5, true), @@ -227,7 +227,7 @@ class Main { DeleteRepo => create(deleteRepo, 0), ConvertXml => create(convertXml, 0), Run => create(run, null), - #if neko + #if !js Proxy => create(proxy, 5, true), #end FixRepo => create(fixRepo, 0), @@ -264,7 +264,7 @@ class Main { try { if (commandInfo.net) { - #if neko + #if !js loadProxy(); #end checkUpdate(); @@ -367,7 +367,7 @@ class Main { return encodedPassword; } - #if neko + #if !js function getContributor(contributors:Array): {name:String, password:String} { var user:String = contributors[0]; @@ -780,7 +780,7 @@ class Main { } } - #if neko + #if !js function proxy() { final rep = getRepositoryPath(); final host = getArgument("Proxy host"); diff --git a/test/IntegrationTests.hx b/test/IntegrationTests.hx index 532c1466..cc6f2b19 100644 --- a/test/IntegrationTests.hx +++ b/test/IntegrationTests.hx @@ -97,6 +97,8 @@ class IntegrationTests extends TestBase { function haxelib(args:Array, ?input:String):Process { final p = #if system_haxelib new Process("haxelib", ["-R", serverUrl].concat(args)); + #elseif haxelib_path + new Process(haxe.macro.Compiler.getDefine("haxelib_path"), ["-R", serverUrl].concat(args)); #else new Process("neko", [haxelibBin, "-R", serverUrl].concat(args)); #end diff --git a/test/RunCi.hx b/test/RunCi.hx index 268b178e..40c4dd0f 100644 --- a/test/RunCi.hx +++ b/test/RunCi.hx @@ -370,19 +370,6 @@ Listen 2000 } static function integrationTests():Void { - function test():Void { - switch (Sys.getEnv("TRAVIS_HAXE_VERSION")) { - case null, "development": - runCommand("haxe", ["integration_tests.hxml"]); - case "3.1.3": - runCommand("haxe", ["integration_tests.hxml", "-D", "system_haxelib"]); - case _: - runCommand("haxe", ["integration_tests.hxml"]); - runCommand("neko", ["bin/integration_tests.n"]); - runCommand("haxe", ["integration_tests.hxml", "-D", "system_haxelib"]); - } - runCommand("neko", ["bin/integration_tests.n"]); - } var dbConfigPath = Path.join(["www", "dbconfig.json"]); saveContent(dbConfigPath, Json.stringify({ user: Sys.getEnv("HAXELIB_DB_USER"), @@ -391,7 +378,14 @@ Listen 2000 port: Std.parseInt(Sys.getEnv("HAXELIB_DB_PORT")), database: Sys.getEnv("HAXELIB_DB_NAME"), }, "\t")); - test(); + runCommand("haxe", ["integration_tests.hxml"]); + runCommand("neko", ["bin/integration_tests.n"]); + runCommand("haxe", [ + "integration_tests.hxml", + "-D", + 'haxelib_path=${Path.join([Sys.getCwd(), "haxelib"])}' + ]); + runCommand("neko", ["bin/integration_tests.n"]); } static function deploy():Void {