Skip to content

Commit

Permalink
Replace deprecated usage of AbstractArchiveTask.getArchivePath
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulFridrick committed Dec 6, 2019
1 parent 5fe23f6 commit 5a74f8e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ private void createDistributionContentTasks(Project project, Distribution distri
TaskProvider<Jar> distributionJarTask = project.getTasks().register(jarTaskName, Jar.class, jar -> {
jar.setDescription("Assembles an application jar suitable for deployment.");
jar.dependsOn(mainJarTask, assetsJarTask);
jar.from(project.zipTree(mainJarTask.get().getArchivePath()));
jar.from(project.zipTree(mainJarTask.get().getArchiveFile().get().getAsFile()));
jar.setDestinationDir(distJarDir);
jar.setBaseName(mainJarTask.get().getBaseName());

Map<String, Object> classpath = new HashMap<>();
classpath.put("Class-Path", new PlayManifestClasspath(project.getConfigurations().getByName(RUNTIME_CLASSPATH_CONFIGURATION_NAME), assetsJarTask.get().getArchivePath()));
classpath.put("Class-Path", new PlayManifestClasspath(project.getConfigurations().getByName(RUNTIME_CLASSPATH_CONFIGURATION_NAME), assetsJarTask.get().getArchiveFile().get().getAsFile()));
jar.getManifest().attributes(classpath);
});

Expand All @@ -107,7 +107,7 @@ private void createDistributionContentTasks(Project project, Distribution distri
CopySpec distSpec = distribution.getContents();
distSpec.into("lib", copySpec -> {
copySpec.from(distributionJarTask);
copySpec.from(assetsJarTask.get().getArchivePath());
copySpec.from(assetsJarTask.get().getArchiveFile().get().getAsFile());
copySpec.from(project.getConfigurations().getByName(RUNTIME_CLASSPATH_CONFIGURATION_NAME));
copySpec.eachFile(new PrefixArtifactFileNames(project.getConfigurations().getByName(RUNTIME_CLASSPATH_CONFIGURATION_NAME)));
});
Expand Down

0 comments on commit 5a74f8e

Please sign in to comment.