Merge pull request #51240 from charles-dyfis-net/buildMaven
buildMaven: Support metadata-only dependencies
This commit is contained in:
commit
735fad9371
@ -15,16 +15,15 @@ infoFile: let
|
|||||||
|
|
||||||
script = writeText "build-maven-repository.sh" ''
|
script = writeText "build-maven-repository.sh" ''
|
||||||
${lib.concatStrings (map (dep: let
|
${lib.concatStrings (map (dep: let
|
||||||
inherit (dep)
|
inherit (dep) sha1 groupId artifactId version metadata repository-id;
|
||||||
url sha1 groupId artifactId
|
|
||||||
version metadata repository-id;
|
|
||||||
|
|
||||||
versionDir = dep.unresolved-version or version;
|
versionDir = dep.unresolved-version or version;
|
||||||
authenticated = dep.authenticated or false;
|
authenticated = dep.authenticated or false;
|
||||||
|
url = dep.url or "";
|
||||||
|
|
||||||
fetch = (if authenticated then requireFile else fetchurl) {
|
fetch = if (url != "") then ((if authenticated then requireFile else fetchurl) {
|
||||||
inherit url sha1;
|
inherit url sha1;
|
||||||
};
|
}) else "";
|
||||||
|
|
||||||
fetchMetadata = (if authenticated then requireFile else fetchurl) {
|
fetchMetadata = (if authenticated then requireFile else fetchurl) {
|
||||||
inherit (metadata) url sha1;
|
inherit (metadata) url sha1;
|
||||||
@ -32,10 +31,15 @@ infoFile: let
|
|||||||
in ''
|
in ''
|
||||||
dir=$out/$(echo ${groupId} | sed 's|\.|/|g')/${artifactId}/${versionDir}
|
dir=$out/$(echo ${groupId} | sed 's|\.|/|g')/${artifactId}/${versionDir}
|
||||||
mkdir -p $dir
|
mkdir -p $dir
|
||||||
ln -sv ${fetch} $dir/${fetch.name}
|
|
||||||
|
${lib.optionalString (fetch != "") ''
|
||||||
|
ln -sv ${fetch} $dir/${fetch.name}
|
||||||
|
''}
|
||||||
${lib.optionalString (dep ? metadata) ''
|
${lib.optionalString (dep ? metadata) ''
|
||||||
ln -svf ${fetchMetadata} $dir/maven-metadata-${repository-id}.xml
|
ln -svf ${fetchMetadata} $dir/maven-metadata-${repository-id}.xml
|
||||||
ln -sv ${fetch} $dir/$(echo ${fetch.name} | sed 's|${version}|${dep.unresolved-version}|')
|
${lib.optionalString (fetch != "") ''
|
||||||
|
ln -sv ${fetch} $dir/$(echo ${fetch.name} | sed 's|${version}|${dep.unresolved-version}|')
|
||||||
|
''}
|
||||||
''}
|
''}
|
||||||
'') info.dependencies)}
|
'') info.dependencies)}
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user