Skip to content

Commit

Permalink
Rename artifact produced by the build to include -min (#1267)
Browse files Browse the repository at this point in the history
Signed-off-by: Xue Zhou <xuezhou@amazon.com>
  • Loading branch information
xuezhou25 authored Sep 22, 2021
1 parent 7135eaf commit 3376b35
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class InternalDistributionArchiveSetupPluginFuncTest extends AbstractGradleFuncT

where:
buildTaskName | expectedOutputArchivePath
"buildDarwinTar" | "darwin-tar/build/distributions/opensearch.tar.gz"
"buildDarwinTar" | "darwin-tar/build/distributions/opensearch-min.tar.gz"
}

def "applies defaults to zip tasks"() {
Expand All @@ -91,7 +91,7 @@ class InternalDistributionArchiveSetupPluginFuncTest extends AbstractGradleFuncT

where:
buildTaskName | expectedOutputArchivePath
"buildDarwinZip" | "darwin-zip/build/distributions/opensearch.zip"
"buildDarwinZip" | "darwin-zip/build/distributions/opensearch-min.zip"
}

def "registered distribution provides archives and directory variant"() {
Expand Down Expand Up @@ -148,8 +148,8 @@ class InternalDistributionArchiveSetupPluginFuncTest extends AbstractGradleFuncT
then: "tar task executed and target folder contains plain tar"
result.task(':buildProducerTar').outcome == TaskOutcome.SUCCESS
result.task(':consumer:copyArchive').outcome == TaskOutcome.SUCCESS
file("producer-tar/build/distributions/opensearch.tar.gz").exists()
file("consumer/build/archives/opensearch.tar.gz").exists()
file("producer-tar/build/distributions/opensearch-min.tar.gz").exists()
file("consumer/build/archives/opensearch-min.tar.gz").exists()

when:
result = gradleRunner("copyDir", "-Pversion=1.0").build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private void configureGeneralTaskDefaults(Project project) {
project.getTasks().withType(AbstractArchiveTask.class).configureEach(t -> {
String subdir = archiveTaskToSubprojectName(t.getName());
t.getDestinationDirectory().set(project.file(subdir + "/build/distributions"));
t.getArchiveBaseName().set("opensearch");
t.getArchiveBaseName().set("opensearch-min");
});
}

Expand Down
2 changes: 1 addition & 1 deletion distribution/docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ext.expansions = { Architecture architecture, DockerBase base, boolean local ->
classifier = "linux-\$(arch)"
}

final String opensearch = "opensearch-${VersionProperties.getOpenSearch()}-${classifier}.tar.gz"
final String opensearch = "opensearch-min-${VersionProperties.getOpenSearch()}-${classifier}.tar.gz"

/* Both the following Dockerfile commands put the resulting artifact at
* the same location, regardless of classifier, so that the commands that
Expand Down
4 changes: 2 additions & 2 deletions distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
// SystemPackagingTask overrides default archive task convention mappings, but doesn't provide a setter so we have to override the convention mapping itself
// Deb convention uses a '_' for final separator before architecture, rpm uses a '.'
if (type == 'deb') {
conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDirectory.get()}/${packageName}_${project.version}${jdkString}_${archString}.${type}")) }
conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDirectory.get()}/${packageName}-min_${project.version}${jdkString}_${archString}.${type}")) }
} else {
conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDirectory.get()}/${packageName}-${project.version}${jdkString}.${archString}.${type}")) }
conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDirectory.get()}/${packageName}-min-${project.version}${jdkString}.${archString}.${type}")) }
}

String packagingFiles = "build/packaging/${jdk ? '' : 'no-jdk-'}${type}"
Expand Down

0 comments on commit 3376b35

Please sign in to comment.