Skip to content

Commit

Permalink
nix: less aggressive patching of repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Aug 30, 2024
1 parent 113f9aa commit 6370edd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions nix/pkgs/patch-maven-srcs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ writeScript "patch-maven-srcs" (''
source ${stdenv}/setup
function patchMavenSource() {
grep "$source" $1 > /dev/null && \
substituteInPlace $1 --replace "$2" "$3" 2>/dev/null
if ! grep -q "mavenLocal()" "$1"; then
sed -i '/repositories {/a \ mavenLocal()' "$1"
fi
}
gradleFile="$1"
# Some of those find something, some don't, that's fine.
patchMavenSource "$gradleFile" 'mavenCentral()' 'mavenLocal()'
patchMavenSource "$gradleFile" 'google()' 'mavenLocal()'
patchMavenSource "$gradleFile" 'jcenter()' 'mavenLocal()'
patchMavenSource "$gradleFile" 'gradlePluginPortal()' 'mavenLocal()'
patchMavenSource "$gradleFile"
'')

0 comments on commit 6370edd

Please sign in to comment.