在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):tadfisher/gradle2nix开源软件地址(OpenSource Url):https://github.com/tadfisher/gradle2nix开源编程语言(OpenSource Language):Kotlin 82.2%开源软件介绍(OpenSource Introduction):Generate Nix expressions which build Gradle-based projects. Why?Nix is an OS-agnostic package manager, a language-agnostic build system, and a bespoke programming language. One of its unique features is that it is purely functional; a “package” is a function which accepts inputs (source code, configuration, etc) and produces an output (binaries, a Java JAR, documentation, really anything). One benefit of a functional build system is reproducibility. If you specify your inputs precisely, and take care not to introduce impurities—such as files retrieved over a network without tracking their content—you will receive, byte-for-byte, the exact output as someone else running the same function over the same inputs. Gradle is not a functional build system. Most Gradle-based projects will produce highly variable outputs depending on a host of impure inputs, including:
This tool is useful for both development and packaging. You can use
InstallationA Nix expression (generated by import (fetchTarball "https://github.com/tadfisher/gradle2nix/archive/master.tar.gz") {} If this expression is in, say, nix build -f gradle2nix.nix You can also use the following one-liners to build or install
# Build and place in ./result/ nix build -f "https://github.com/tadfisher/gradle2nix/archive/master.tar.gz" # Build and install in the user profile nix-env -if "https://github.com/tadfisher/gradle2nix/archive/master.tar.gz"
Flake (experimental)A flake.nix is provided for those using Nix flakes. For example, the
following will build and run nix run github:tadfisher/gradle2nix -- --help UsageUsage: gradle2nix [OPTIONS] [PROJECT-DIR] Options: -g, --gradle-version VERSION Use a specific Gradle version -a, --gradle-args ARGS Extra arguments to pass to Gradle -c, --configuration NAME Add a configuration to resolve (default: all configurations) -i, --include DIR Add an additional project to include -p, --project PATH Only resolve these subproject paths, e.g. ':', or ':sub:project' (default: all projects) -o, --out-dir DIR Path to write generated files (default: PROJECT-DIR) -e, --env FILENAME Prefix for environment files (.json and .nix) (default: gradle-env) -b, --build-src / -nb, --no-build-src Include buildSrc project (default: true) -q, --quiet Disable logging -h, --help Show this message and exit Arguments: PROJECT-DIR Path to the project root (default: .) Simply running Specifying the Gradle versionBy default, if the project has configured the Gradle wrapper, that
version will be detected and pinned; otherwise, the version of Gradle
installed on your system will be pinned. You can override this with
the gradle2nix -g 6.1 Multi-project buildsIf you want to resolve only a subset of projects in a multi-project
build, add the gradle2nix -p :app -p :widget Any project dependencies will be also be included when pinning dependency artifacts. ContributingBug reports and feature requests are encouraged. Code contributions are also encouraged. Please review the test cases in the fixtures directory and create a new one to reproduce any fixes or test new features. See the existing compatibility tests for examples of testing with these fixtures. License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论