Giter Site home page Giter Site logo

Comments (4)

clo4 avatar clo4 commented on July 2, 2024

Definitely Python. It has everything I need build into its standard library, and the file watcher should be done externally, eg. using entr, watch, etc. Having to set up a virtual environment is a hard no, so all file watching packages are out of the picture. While I could use Deno for its better dependency management, the complexity of JS/TS isn't worth it for this.

from datapacks.

clo4 avatar clo4 commented on July 2, 2024

More thinking. There shouldn't be one major build script, instead each project should have its own that can support its own features, and there can be a sort of orchestration script that executes all of them in parallel in the root directory.

from datapacks.

clo4 avatar clo4 commented on July 2, 2024

So here's my current idea. There will be an executable file in each datapack's directory called build.fish, using fish for its sane shell scripting syntax. This is the logic responsible for zipping the contents and creating the datapack. Each build script will create a zip file called datapack.zip in the current directory. As part of the Nix flake builder, it will then rename this datapack according to the name and version specified.

Using the builder should look something like this:

{ buildDataPack }:
buildDataPack {
  pname = "afk";
  version = "1.2";
  minMinecraftVersion = "1.13.x";
  maxMinecraftVersion = "1.21.0";
  src = ./.;
}

And the build script might look like this:

set files LICENSE pack.png pack.mcmeta data

rm -rf build
mkdir -p build
cp -R $files build
cd build

# Older version compatibility
for dir in **/function
  cp $dir {$dir}s
end

zip -r ../datapack.zip $files

obviously there could be more complicated logic there, but that's a starting point and for most should be all that's necessary.

from datapacks.

clo4 avatar clo4 commented on July 2, 2024

... and that's basically what I did. New build system landed in 4ef8015, except it doesn't use a build script, the compat logic is handled by the preBuild phase in each default.nix. This is also where the minimum and maximum minecraft versions that it supports are defined. The build phase is just zipping the contents of the zip list, and the install phase is moving it to the correct location with the correct name. The output contents will be the same as they would have been with the old build script.

from datapacks.

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.