blob: dba3d03868cdbe493dbd7a76cfe499bdf8334bb9 [file]
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.teaclave.javasdk</groupId>
<artifactId>JavaEnclave</artifactId>
<version>0.1.0</version>
</parent>
<artifactId>enclave</artifactId>
<packaging>jar</packaging>
<name>JavaEnclave-Enclave</name>
<properties>
<graal.version>22.2.0</graal.version>
</properties>
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>build</goal>
</goals>
<configuration>
<imageName>libsvm_enclave_sdk</imageName>
<buildArgs>
<buildArg>--shared</buildArg>
<buildArg>--no-fallback</buildArg>
<buildArg>-H:+RunInEnclave</buildArg>
<buildArg>-H:OutputRelocatableImage=.</buildArg>
<buildArg>-H:Path=svm-output</buildArg>
</buildArgs>
</configuration>
<phase>package</phase>
</execution>
<execution>
<id>test-native</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<buildArgs>
<buildArg>--no-fallback</buildArg>
<buildArg>-H:+RunInEnclave</buildArg>
</buildArgs>
</configuration>
<phase>test</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>JavaEnclaveNativeCompile</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>${project.basedir}/../native/script/build_enclave_sdk/make.sh</argument>
<argument>${project.basedir}</argument>
<argument>${org.apache.teaclave.javasdk.platform}</argument>
<argument>build</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>--add-modules</arg>
<arg>jdk.internal.vm.ci,jdk.internal.vm.compiler,jdk.crypto.ec</arg>
<arg>--add-exports</arg>
<arg>jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.internal.vm.compiler/org.graalvm.compiler.serviceprovider=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.internal.vm.compiler/org.graalvm.compiler.options=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.internal.vm.compiler/org.graalvm.compiler.word=ALL-UNNAMED</arg>
<arg>--add-exports</arg>
<arg>jdk.crypto.ec/sun.security.ec=ALL-UNNAMED</arg>
</compilerArgs>
<!--OptionProcessor can automatically generate OptionDescriptor classes at javac time-->
<annotationProcessorPaths>
<path>
<groupId>org.graalvm.compiler</groupId>
<artifactId>graal-processor</artifactId>
<version>${graal.version}</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
<annotationProcessor>org.graalvm.compiler.options.processor.OptionProcessor</annotationProcessor>
</annotationProcessors>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
<doclint>none</doclint>
<additionalJOptions>
<additionalJOption>--add-modules</additionalJOption>
<additionalJOption>jdk.internal.vm.ci,jdk.internal.vm.compiler,jdk.crypto.ec</additionalJOption>
<additionalJOption>--add-exports</additionalJOption>
<additionalJOption>jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports</additionalJOption>
<additionalJOption>jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports</additionalJOption>
<additionalJOption>jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports</additionalJOption>
<additionalJOption>jdk.internal.vm.compiler/org.graalvm.compiler.serviceprovider=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports</additionalJOption>
<additionalJOption>jdk.internal.vm.compiler/org.graalvm.compiler.options=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports</additionalJOption>
<additionalJOption>jdk.internal.vm.compiler/org.graalvm.compiler.word=ALL-UNNAMED</additionalJOption>
<additionalJOption>--add-exports</additionalJOption>
<additionalJOption>jdk.crypto.ec/sun.security.ec=ALL-UNNAMED</additionalJOption>
</additionalJOptions>
</configuration>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.3</version>
<configuration>
<includes>
<include>org/apache/teaclave/javasdk/enclave/**/*</include>
</includes>
</configuration>
<executions>
<execution>
<id>pre-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graal.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
<version>${graal.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>pointsto</artifactId>
<version>${graal.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>junit-platform-native</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.teaclave.javasdk</groupId>
<artifactId>common</artifactId>
</dependency>
</dependencies>
</project>