Skip to content

Commit

Permalink
🥺🥺🥺
Browse files Browse the repository at this point in the history
  • Loading branch information
umjammer committed Feb 18, 2024
1 parent 4ef738e commit 25b779b
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 80 deletions.
186 changes: 107 additions & 79 deletions rococoa-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<profiles>
<profile>
<id>test1</id>
<id>test-standalone</id>
<build>
<plugins>
<plugin>
Expand All @@ -45,81 +45,94 @@
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.0-alpha-11</version>
<extensions>true</extensions>
<configuration>
<compilerProvider>generic-classic</compilerProvider>
<compilerStartOptions>
<compilerStartOption>-g -Wall -O2 -fomit-frame-pointer -fPIC</compilerStartOption>
<compilerStartOption>-arch x86_64 -arch arm64</compilerStartOption>
</compilerStartOptions>
<linkerStartOptions>
<linkerStartOption>-dynamiclib -arch x86_64 -arch arm64
-framework Foundation
</linkerStartOption>
</linkerStartOptions>
<linkerFinalName/>
</configuration>
<executions>
<execution>
<id>test-daylib</id>
<phase>test-compile</phase>
<goals>
<goal>compile</goal>
<goal>link</goal>
</goals>
<configuration>
<sources>
<source>
<!-- relative to your project directory -->
<directory>src/main/native</directory>
<fileNames>
<fileName>Rococoa.m</fileName>
<fileName>ProxyForJava.m</fileName>
<fileName>ObjCBlocks.m</fileName>
<fileName>test.m</fileName>
</fileNames>
</source>
</sources>
<linkerEndOptions>
<linkerEndOption>-o ${project.build.testOutputDirectory}/librococoa.dylib</linkerEndOption>
</linkerEndOptions>
</configuration>
</execution>
<execution>
<id>daylib</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
<goal>link</goal>
</goals>
<profile>
<id>native</id>
<activation>
<property>
<name>env.JITPACK</name>
<value>!true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.0-alpha-11</version>
<extensions>true</extensions>
<configuration>
<sources>
<source>
<!-- relative to your project directory -->
<directory>src/main/native</directory>
<fileNames>
<fileName>Rococoa.m</fileName>
<fileName>ProxyForJava.m</fileName>
<fileName>ObjCBlocks.m</fileName>
</fileNames>
</source>
</sources>
<linkerEndOptions>
<linkerEndOption>-o ${project.build.outputDirectory}/librococoa.dylib</linkerEndOption>
</linkerEndOptions>
<compilerProvider>generic-classic</compilerProvider>
<compilerStartOptions>
<compilerStartOption>-g -Wall -O2 -fomit-frame-pointer -fPIC</compilerStartOption>
<compilerStartOption>-arch x86_64 -arch arm64</compilerStartOption>
</compilerStartOptions>
<linkerStartOptions>
<linkerStartOption>-dynamiclib -arch x86_64 -arch arm64
-framework Foundation
</linkerStartOption>
</linkerStartOptions>
<linkerFinalName/>
</configuration>
</execution>
</executions>
</plugin>
<executions>
<execution>
<id>test-daylib</id>
<phase>test-compile</phase>
<goals>
<goal>compile</goal>
<goal>link</goal>
</goals>
<configuration>
<sources>
<source>
<!-- relative to your project directory -->
<directory>src/main/native</directory>
<fileNames>
<fileName>Rococoa.m</fileName>
<fileName>ProxyForJava.m</fileName>
<fileName>ObjCBlocks.m</fileName>
<fileName>test.m</fileName>
</fileNames>
</source>
</sources>
<linkerEndOptions>
<linkerEndOption>-o ${project.build.testOutputDirectory}/librococoa.dylib</linkerEndOption>
</linkerEndOptions>
</configuration>
</execution>
<execution>
<id>daylib</id>
<phase>prepare-package</phase>
<goals>
<goal>compile</goal>
<goal>link</goal>
</goals>
<configuration>
<sources>
<source>
<!-- relative to your project directory -->
<directory>src/main/native</directory>
<fileNames>
<fileName>Rococoa.m</fileName>
<fileName>ProxyForJava.m</fileName>
<fileName>ObjCBlocks.m</fileName>
</fileNames>
</source>
</sources>
<linkerEndOptions>
<linkerEndOption>-o ${project.build.outputDirectory}/librococoa.dylib</linkerEndOption>
</linkerEndOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -154,14 +167,35 @@
<configuration>
<reuseForks>false</reuseForks>
<argLine>
-Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties
-Djava.util.logging.config.file=${project.build.testOutputDirectory}/test-logging.properties
--add-opens java.base/java.lang=ALL-UNNAMED
</argLine>
<trimStackTrace>false</trimStackTrace>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<excludes>
<exclude>Test1.java</exclude>
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<includes>
<include>Test1.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand All @@ -182,12 +216,6 @@
<artifactId>byte-buddy</artifactId>
</dependency>

<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<version>1.9.15</version>
</dependency>

<dependency>
<groupId>com.github.umjammer</groupId>
<artifactId>vavi-commons</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion rococoa-core/src/test/java/Test1.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void test1() throws Exception {
void test2() throws Exception {
String jh = System.getProperty("java.home");
Debug.println("JAVA_HOME: " + jh);
ProcessBuilder pb = new ProcessBuilder().command("mvn", "-P", "test1", "antrun:run", "-Dvalue=umjammer");
ProcessBuilder pb = new ProcessBuilder().command("mvn", "-P", "test-standalone", "antrun:run", "-Dvalue=umjammer");
Map<String, String> env = pb.environment();
env.put("JAVA_HOME", jh);
pb.redirectErrorStream(true);
Expand Down

0 comments on commit 25b779b

Please sign in to comment.