Skip to content

Commit

Permalink
Ignore missing AWT library in MacOS
Browse files Browse the repository at this point in the history
- This is a workaround until oracle/graal#4124 is fixed
  • Loading branch information
gastaldi committed Feb 4, 2023
1 parent 399d387 commit f276c14
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkiverse.poi.deployment;

import java.util.function.BooleanSupplier;

import org.apache.xmlbeans.StringEnumAbstractBase;
import org.apache.xmlbeans.XmlObject;
import org.jboss.jandex.ClassInfo;
Expand All @@ -12,7 +14,10 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.NativeImageFeatureBuildItem;
import io.quarkus.deployment.builditem.SystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.pkg.steps.NativeBuild;
import io.quarkus.utilities.OS;

class POIProcessor {

Expand All @@ -34,6 +39,11 @@ void indexTransitiveDependencies(BuildProducer<IndexDependencyBuildItem> index)
index.produce(new IndexDependencyBuildItem("org.apache.poi", "poi-ooxml-full"));
}

@BuildStep(onlyIf = { NativeBuild.class, IsMac.class })
SystemPropertyBuildItem ignoreMissingFontSystem() {
return new SystemPropertyBuildItem("org.apache.poi.ss.ignoreMissingFontSystem", "true");
}

@BuildStep
void registerXMLBeansClassesForReflection(CombinedIndexBuildItem combinedIndexBuildItem,
BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
Expand All @@ -45,4 +55,11 @@ void registerXMLBeansClassesForReflection(CombinedIndexBuildItem combinedIndexBu
reflectiveClass.produce(new ReflectiveClassBuildItem(false, true, implementor.name().toString()));
}
}

static class IsMac implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
return OS.MAC == OS.determineOS();
}
}
}

0 comments on commit f276c14

Please sign in to comment.