xref: /JGit/tools/maven-central/download.rb (revision f2bfaca08484b5547448640a01bf69f4f1176b17)
18de35128SMatthias Sohn#!/usr/bin/env ruby
2be25ecb3SMatthias Sohnversion = ARGV[0].freeze
3be25ecb3SMatthias Sohnif version =~ /\A(\d+\.\d+\.\d+)\.(\d{12})-(m\d|rc\d|r)\Z/
4be25ecb3SMatthias Sohn   printf "version %s qualifier %s classifier %s\n", $1, $2, $3
5be25ecb3SMatthias Sohnelse
6be25ecb3SMatthias Sohn   printf "invalid version %s\n", version
7be25ecb3SMatthias Sohn   abort
8be25ecb3SMatthias Sohnend
9be25ecb3SMatthias Sohn
108de35128SMatthias Sohngroup = 'org.eclipse.jgit'
118de35128SMatthias Sohnartifacts = [group,
128de35128SMatthias Sohn             group + '.ant',
138de35128SMatthias Sohn             group + '.archive',
14*f2bfaca0SMatthias Sohn             group + '.gpg.bc',
15f59b680cSMatthias Sohn             group + '.http.apache',
168de35128SMatthias Sohn             group + '.http.server',
178de35128SMatthias Sohn             group + '.junit',
188de35128SMatthias Sohn             group + '.junit.http',
195218d2f5SMatthias Sohn             group + '.junit.ssh',
2024b6c080SMatthias Sohn             group + '.lfs',
2124b6c080SMatthias Sohn             group + '.lfs.server',
228de35128SMatthias Sohn             group + '.pgm',
235218d2f5SMatthias Sohn             group + '.ssh.apache',
24*f2bfaca0SMatthias Sohn             group + '.ssh.jsch',
258de35128SMatthias Sohn             group + '.ui']
268de35128SMatthias Sohn
278de35128SMatthias Sohnputs 'Deleting current files'
288de35128SMatthias Sohn`rm -fr *.jar *.sh *.pom`
298de35128SMatthias Sohn
308de35128SMatthias Sohnputs 'Downloading org.eclipse.jgit-parent'
318de35128SMatthias Sohn`curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{group}-parent/#{version}/#{group}-parent-#{version}.pom -o #{group}-parent-#{version}.pom`
328de35128SMatthias Sohn
338de35128SMatthias Sohnartifacts.each {|artifact|
348de35128SMatthias Sohn  puts "Downloading #{artifact}-#{version}.jar"
358de35128SMatthias Sohn  `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}.jar -o #{artifact}-#{version}.jar`
368de35128SMatthias Sohn  `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}.pom -o #{artifact}-#{version}.pom`
378de35128SMatthias Sohn  `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}-javadoc.jar -o #{artifact}-#{version}-javadoc.jar`
388de35128SMatthias Sohn  `curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{artifact}/#{version}/#{artifact}-#{version}-sources.jar -o #{artifact}-#{version}-sources.jar`
398de35128SMatthias Sohn}
408de35128SMatthias Sohn
418de35128SMatthias Sohnputs "Downloading org.eclipse.jgit.pgm-#{version}.sh"
428de35128SMatthias Sohn`curl -s https://repo.eclipse.org/content/repositories/jgit-releases/org/eclipse/jgit/#{group}.pgm/#{version}/#{group}.pgm-#{version}.sh -o #{group}.pgm-#{version}.sh`
43