apply plugin: RiskscapePluginProjectPlugin

riskscapePlugin {
  implementation = 'nz.org.riskscape.hdf5.Hdf5Plugin'
    // for some reason adding this as a `files` dependency to the plugin does nothing
  pluginResources = ['lib/jarhdf5-1.12.2.jar']
}

dependencies {
  plugin files('lib/jarhdf5-1.12.2.jar')
  implementation project(':engine:app')

  testImplementation project(':plugin:defaults')
}


test {
  useJUnit {
    excludeCategories 'nz.org.riskscape.engine.cli.CliIntegrationTest'
    excludeCategories 'nz.org.riskscape.hdf5.H5TestMarker'
    if(System.getenv("OS")!=null) {
      excludeCategories 'nz.org.riskscape.test.SkipTestOnWindows'
    }
  }
  testLogging {
    showStandardStreams = true
  }
}


task(hdf5Test, type: Test, dependsOn: installDist) {

  systemProperty "hdf.hdf5lib.H5.hdf5lib", System.getenv().getOrDefault("HD5L_LIB", "/opt/hdf5-1.12.2/lib/libhdf5_java.so")

  outputs.upToDateWhen {
    // always run tests
    false
  }
  useJUnit {
    includeCategories 'nz.org.riskscape.hdf5.H5TestMarker'
  }
  testLogging {
      showStandardStreams = true
  }
}


task(cliTest, type: Test, dependsOn: installDist) {


  outputs.upToDateWhen {
    // always run tests
    false
  }
  useJUnit {
    includeCategories 'nz.org.riskscape.engine.cli.CliIntegrationTest'
  }
  testLogging {
      showStandardStreams = true
  }
}
