Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] Rename build artifact to include -min #1267

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rename artifact produced by the build to include -min
Signed-off-by: Xue Zhou <xuezhou@amazon.com>
  • Loading branch information
xuezhou25 committed Sep 21, 2021
commit 99d743cf972373ea2a073355c210a01b50c0b458
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