Skip to content

Commit

Permalink
Ensure that compressed binary used in Amazon Lambda function if present
Browse files Browse the repository at this point in the history
Fixes: quarkusio#27208
(cherry picked from commit 5481675)
  • Loading branch information
geoand authored and gsmet committed Aug 23, 2022
1 parent 4f10401 commit 06e9ac5
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.stream.Stream;

import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
Expand All @@ -22,6 +23,7 @@
import io.quarkus.deployment.pkg.builditem.LegacyJarRequiredBuildItem;
import io.quarkus.deployment.pkg.builditem.NativeImageBuildItem;
import io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem;
import io.quarkus.deployment.pkg.builditem.UpxCompressedBuildItem;
import io.quarkus.deployment.pkg.steps.NativeBuild;

/**
Expand Down Expand Up @@ -103,6 +105,7 @@ public void jvmZip(OutputTargetBuildItem target,
*/
@BuildStep(onlyIf = { IsNormal.class, NativeBuild.class })
public void nativeZip(OutputTargetBuildItem target,
Optional<UpxCompressedBuildItem> upxCompressed, // used to ensure that we work with the compressed native binary if compression was enabled
BuildProducer<ArtifactResultBuildItem> artifactResultProducer,
NativeImageBuildItem nativeImage) throws Exception {
Path zipDir = findNativeZipDir(target.getOutputDirectory());
Expand Down

0 comments on commit 06e9ac5

Please sign in to comment.