Skip to content

Commit

Permalink
#126: Fixed issue with not existing dummy file, harmonized usage of L…
Browse files Browse the repository at this point in the history
…istProperty and cleaned up build.gradle for metapublisher
  • Loading branch information
Sabrina Wullschleger committed Mar 28, 2024
1 parent 67f3bcc commit 762b358
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ apply plugin: 'ch.so.agi.gretl'

defaultTasks 'publishMetaFiles'

tasks.register('foo') {
doLast {
println "bar"
}
}

tasks.register('publishFiles', Publisher) {
dependsOn 'foo'
dataIdent = "ch.so.agi.av.dm01_so"
target = [project.buildDir]
sourcePath = file("itf/dummy.itf")
Expand All @@ -27,14 +20,3 @@ tasks.register('publishMetaFiles', MetaPublisher) {
target = [project.buildDir]
regions = publishFiles.publishedRegions
}

/*
tasks.register('printPublishedRegions') {
dependsOn 'publishFiles'
doLast() {
publishFile.publishedRegions.get().each {
println it
}
}
}
*/
4 changes: 2 additions & 2 deletions gretl/src/main/java/ch/so/agi/gretl/tasks/MetaPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class MetaPublisher extends DefaultTask {

private Endpoint target = null; // Zielverzeichnis

private ListProperty<String> regions = null; // Publizierte Regionen (aus Publisher-Task)
private ListProperty<String> regions = getProject().getObjects().listProperty(String.class); // Publizierte Regionen (aus Publisher-Task)
private Endpoint geocatTarget = null; // Geocat-Zielverzeichnis

@InputFile
Expand Down Expand Up @@ -111,7 +111,7 @@ public void publishAll() {

MetaPublisherStep step = new MetaPublisherStep();
try {
step.execute(metaConfigFile, targetFile, regions!=null?regions.get():null, geocatTargetFile, gretlEnvironment);
step.execute(metaConfigFile, targetFile, regions.get().isEmpty() ? null: regions.get(), geocatTargetFile, gretlEnvironment);
} catch (IOException | IoxException | Ili2cException | SaxonApiException | TemplateException e) {
log.error("failed to run MetaPublisher", e);

Expand Down
2 changes: 1 addition & 1 deletion gretl/src/main/java/ch/so/agi/gretl/tasks/Publisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public String getDataIdent() {
public Endpoint getTarget() {
return target;
}
@InputFile
@Input
@Optional
public Object getSourcePath() {
return sourcePath;
Expand Down

0 comments on commit 762b358

Please sign in to comment.