Skip to content

Commit

Permalink
fix(resources): download INSPIRE schemas from GitHub repo
Browse files Browse the repository at this point in the history
...instead of website. The website used to be a static directory listing
but has now changed to a page that requires Javascript.

ING-3236
  • Loading branch information
stempler committed Oct 24, 2023
1 parent 334260f commit bd88468
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions modules/resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,28 @@ task downloadInspireSchemas() {
// delete existing schema archive
inspireSchemas.delete()

// download Zip (TODO better way, e.g. Gradle download task?)
exec {
workingDir = temporaryDir
executable = 'wget'
args '-e', 'robots=off', '-r', '--no-parent', '--no-host-directories', '-A', 'xsd,xml,txt', 'https://inspire.ec.europa.eu/schemas/'
args 'https://github.com/INSPIRE-MIF/application-schemas/archive/refs/heads/main.zip'
}
exec {
workingDir = temporaryDir
executable = 'wget'
args '-e', 'robots=off', '-r', '--no-parent', '-X', 'draft-schemas/geoportal', '--no-host-directories', '-A', 'xsd,xml,txt', 'https://inspire.ec.europa.eu/draft-schemas/'
// unzip
def zipFile = new File(temporaryDir, 'main.zip')
ant.unzip(src: zipFile, dest: temporaryDir)
// delete zip file
zipFile.delete()
// move content up out of "application-schemas-main"
ant.move(todir: temporaryDir) {
ant.fileset(dir: new File(temporaryDir, 'application-schemas-main')) {
// only include XML schemas
include( name: '**/*.xsd' )
// README that includes information about the state/date
include( name: '**/readme.txt' )
}
}
// delete remainder
delete(new File(temporaryDir, 'application-schemas-main'))
// add fixups
copy {
from new File(projectDir, 'inspire-fixup')
Expand Down

0 comments on commit bd88468

Please sign in to comment.