@@ -56,7 +56,7 @@ private void configure(JavaExec exec) {
5656 exec
5757 .workingDir (extension .getInstallationDirectory ())
5858 .classpath (new File (extension .getInstallationDirectory ().get (), "structure101-java-build.jar" ))
59- .args (new File (new File (project .getBuildDir (), "s101" ), "config.xml" ))
59+ .args (new File (new File (project .getLayout (). getBuildDirectory (). get (). getAsFile (), "s101" ), "config.xml" ))
6060 .systemProperty ("s101.label" , computeLabel (extension ).get ())
6161 .doFirst ((task ) -> {
6262 installAndConfigureIfNeeded (project );
@@ -95,12 +95,12 @@ private void installAndConfigureIfNeeded(Project project) {
9595
9696 private void copyConfigurationToBuildDirectory (S101PluginExtension extension , Project project ) {
9797 Path configurationDirectory = extension .getConfigurationDirectory ().get ().toPath ();
98- Path buildDirectory = project .getBuildDir ().toPath ();
98+ Path buildDirectory = project .getLayout (). getBuildDirectory (). get (). getAsFile ().toPath ();
9999 copyDirectory (project , configurationDirectory , buildDirectory );
100100 }
101101
102102 private void copyResultsBackToConfigurationDirectory (S101PluginExtension extension , Project project ) {
103- Path buildConfigurationDirectory = project .getBuildDir ().toPath ().resolve ("s101" );
103+ Path buildConfigurationDirectory = project .getLayout (). getBuildDirectory (). get (). getAsFile ().toPath ().resolve ("s101" );
104104 String label = extension .getLabel ().get ();
105105 if ("baseline" .equals (label )) { // a new baseline was created
106106 copyDirectory (project , buildConfigurationDirectory .resolve ("repository" ).resolve ("snapshots" ),
@@ -122,7 +122,7 @@ private void copyDirectory(Project project, Path source, Path destination) {
122122 }
123123 InputStream input ;
124124 if ("project.java.hsp" .equals (each .toFile ().getName ())) {
125- Path relativeTo = project .getBuildDir ().toPath ().resolve ("s101" ).relativize (project .getProjectDir ().toPath ());
125+ Path relativeTo = project .getLayout (). getBuildDirectory (). get (). getAsFile ().toPath ().resolve ("s101" ).relativize (project .getProjectDir ().toPath ());
126126 String value = "const(THIS_FILE)/" + relativeTo ;
127127 input = replace (each , "<property name=\" relative-to\" value=\" (.*)\" />" , "<property name=\" relative-to\" value=\" " + value + "\" />" );
128128 } else if (each .toFile ().toString ().endsWith (".xml" )) {
0 commit comments