mirror of
https://github.com/tadfisher/gradle2nix.git
synced 2026-01-12 16:00:38 -05:00
app: move static files to /share
This commit is contained in:
54
app/src/dist/share/gradle-env.nix
vendored
Normal file
54
app/src/dist/share/gradle-env.nix
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
# This file is generated by gradle2nix.
|
||||
|
||||
{ stdenvNoCC, lib, buildEnv, fetchurl }:
|
||||
|
||||
{ name, repositories, dependencies }:
|
||||
|
||||
let
|
||||
mkPath = artifact: with artifact; lib.concatStringsSep "/" [
|
||||
(lib.replaceChars ["."] ["/"] artifact.groupId)
|
||||
artifact.artifactId
|
||||
artifact.version
|
||||
];
|
||||
|
||||
mkFilename = artifact: with artifact;
|
||||
"${artifactId}-${version}${lib.optionalString (classifier != "") "-${classifier}"}.${extension}";
|
||||
|
||||
mkMavenUrls = repo: artifact:
|
||||
|
||||
|
||||
mkArtifactUrl = base: artifact:
|
||||
"${lib.removeSuffix "/" base}/${mkPath artifact}/${mkFilename artifact}";
|
||||
|
||||
fetchArtifact = artifact:
|
||||
let
|
||||
artifactPath = mkPath artifact;
|
||||
artifactName = mkFilename artifact;
|
||||
in stdenvNoCC.mkDerivation rec {
|
||||
name = with artifact; lib.concatStrings [
|
||||
(lib.replaceChars ["."] ["_"] groupId) "-"
|
||||
(lib.replaceChars ["."] ["_"] artifactId) "-"
|
||||
version
|
||||
(lib.optionalString (classifier != "") "-${classifier}")
|
||||
"-" type
|
||||
];
|
||||
|
||||
src = fetchurl {
|
||||
name = mkFilename artifact;
|
||||
urls = map (url: mkArtifactUrl url artifact) repositories;
|
||||
inherit (artifact) sha256;
|
||||
};
|
||||
|
||||
phases = "installPhase fixupPhase";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/${artifactPath}
|
||||
ln -s ${src} $out/${artifactPath}/${artifactName}
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
buildEnv {
|
||||
inherit name;
|
||||
paths = map fetchArtifact dependencies;
|
||||
}
|
||||
7
app/src/dist/share/init.gradle
vendored
Normal file
7
app/src/dist/share/init.gradle
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
initscript {
|
||||
dependencies {
|
||||
classpath files("plugin.jar")
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: org.nixos.gradle2nix.Gradle2NixPlugin
|
||||
Reference in New Issue
Block a user