File tree Expand file tree Collapse file tree 2 files changed +31
-7
lines changed
Expand file tree Collapse file tree 2 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 1111 repositories ? [ "https://plugins.gradle.org/m2/" "https://repo1.maven.org/maven2/" ] ,
1212 verificationFile ? "gradle/verification-metadata.xml" ,
1313} : let
14- filteredSrc = lib . fileset . toSource {
15- root = src ;
16- fileset = lib . path . append src verificationFile ;
17- } ;
14+ verificationXmlFile =
15+ if lib . isPath src
16+ then lib . path . append src verificationFile
17+ else let
18+ storePathPrefix = "${ src } /" ;
19+ in
20+ lib . cleanSourceWith {
21+ src = storePathPrefix ;
22+ filter = path : type : let
23+ relPath = lib . removePrefix storePathPrefix path ;
24+ in
25+ if type == "directory"
26+ then lib . strings . hasPrefix relPath verificationFile
27+ else relPath == verificationFile ;
28+ }
29+ + "/"
30+ + verificationFile ;
1831
1932 depSpecs = builtins . filter dependencyFilter (
2033 # Read all build and runtime dependencies from the verification-metadata XML
2134 builtins . fromJSON ( builtins . readFile (
2235 runCommand "depSpecs" { buildInputs = [ python3 ] ; }
23- "python ${ ./parse.py } ${ filteredSrc } / ${ verificationFile } ${ builtins . toString ( builtins . map lib . escapeShellArg repositories ) } > $out"
36+ "python ${ ./parse.py } ${ verificationXmlFile } ${ builtins . toString ( builtins . map lib . escapeShellArg repositories ) } > $out"
2437 ) )
2538 ) ;
2639 mkDep = depSpec : {
3447 # write a dedicated script for the m2 repository creation. Otherwise, the m2Repository derivation might crash with 'Argument list too long'
3548 m2Repository =
3649 runCommand "${ pname } -${ version } -m2-repository"
37- { src = filteredSrc ; }
50+ { }
3851 (
3952 "mkdir $out"
4053 + lib . concatMapStringsSep "\n " ( dep : "mkdir -p $out/${ dep . path } \n ln -s ${ builtins . toString dep . jar } $out/${ dep . path } /${ dep . name } " ) dependencies
Original file line number Diff line number Diff line change 1313 buildGradleApplication {
1414 inherit gradle version jdk ;
1515 pname = "hello-world" ;
16- src = ./. ;
16+ src = lib . cleanSourceWith {
17+ src = lib . cleanSource ./. ;
18+ filter = path : type : let
19+ ignore = builtins . elem ( baseNameOf path ) ;
20+ in
21+ ! ignore [
22+ "package.nix"
23+ "gradlew.bat"
24+ "gradlew"
25+ ] ;
26+ } ;
27+
1728 meta = with lib ; {
1829 description = "Hello World Application" ;
1930 longDescription = ''
You can’t perform that action at this time.
0 commit comments