211 lines
8.5 KiB
XML
211 lines
8.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<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/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<parent>
|
|
<groupId>dev.k3vinb5</groupId>
|
|
<artifactId>unyo-core</artifactId>
|
|
<version>1.0.0</version>
|
|
</parent>
|
|
|
|
<artifactId>androidcompat</artifactId>
|
|
<name>Unyo Core Android Compatibility</name>
|
|
<description>Android compatibility layer for running Aniyomi extensions on desktop JVM</description>
|
|
<packaging>jar</packaging>
|
|
|
|
<properties>
|
|
<android.sdk.version>34</android.sdk.version>
|
|
<android.jar.output>${project.build.directory}/android.jar</android.jar.output>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
<!-- Kotlin -->
|
|
<dependency>
|
|
<groupId>org.jetbrains.kotlin</groupId>
|
|
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.jetbrains.kotlinx</groupId>
|
|
<artifactId>kotlinx-coroutines-core</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Logging -->
|
|
<dependency>
|
|
<groupId>org.jboss.logging</groupId>
|
|
<artifactId>jboss-logging</artifactId>
|
|
</dependency>
|
|
|
|
<!-- JSON -->
|
|
<dependency>
|
|
<groupId>com.google.code.gson</groupId>
|
|
<artifactId>gson</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.jetbrains.kotlinx</groupId>
|
|
<artifactId>kotlinx-serialization-json</artifactId>
|
|
</dependency>
|
|
|
|
<!-- HtmlUnit for WebView implementation -->
|
|
<dependency>
|
|
<groupId>org.htmlunit</groupId>
|
|
<artifactId>htmlunit</artifactId>
|
|
</dependency>
|
|
|
|
<!-- RxJava -->
|
|
<dependency>
|
|
<groupId>io.reactivex</groupId>
|
|
<artifactId>rxjava</artifactId>
|
|
</dependency>
|
|
|
|
<!--
|
|
Android SDK JAR (stripped - only SDK classes we don't stub).
|
|
Added as a system dependency so IntelliJ IDEA indexes it for
|
|
code navigation and completion.
|
|
|
|
NOTE: The JAR is downloaded during `mvn clean compile` via the
|
|
get-android.sh script. If IntelliJ shows it as missing, run:
|
|
cd androidcompat && ./scripts/get-android.sh
|
|
Then right-click pom.xml → Maven → Reload Project.
|
|
-->
|
|
<dependency>
|
|
<groupId>com.google.android</groupId>
|
|
<artifactId>android-sdk-stripped</artifactId>
|
|
<version>${android.sdk.version}</version>
|
|
<scope>system</scope>
|
|
<systemPath>${project.build.directory}/android.jar</systemPath>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<!-- Kotlin Plugin -->
|
|
<plugin>
|
|
<groupId>org.jetbrains.kotlin</groupId>
|
|
<artifactId>kotlin-maven-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>compile</id>
|
|
<phase>process-sources</phase>
|
|
<goals>
|
|
<goal>compile</goal>
|
|
</goals>
|
|
</execution>
|
|
<execution>
|
|
<id>test-compile</id>
|
|
<phase>test-compile</phase>
|
|
<goals>
|
|
<goal>test-compile</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<jvmTarget>17</jvmTarget>
|
|
</configuration>
|
|
</plugin>
|
|
|
|
<!-- Compiler Plugin -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>default-compile</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
<execution>
|
|
<id>default-testCompile</id>
|
|
<phase>none</phase>
|
|
</execution>
|
|
<execution>
|
|
<id>compile</id>
|
|
<phase>compile</phase>
|
|
<goals>
|
|
<goal>compile</goal>
|
|
</goals>
|
|
</execution>
|
|
<execution>
|
|
<id>testCompile</id>
|
|
<phase>test-compile</phase>
|
|
<goals>
|
|
<goal>testCompile</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
|
|
<!--
|
|
Exec Plugin to run Android SDK download script
|
|
Downloads android.jar from Sable/android-platforms repo
|
|
and patches it to remove classes with custom implementations
|
|
-->
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>exec-maven-plugin</artifactId>
|
|
<version>3.1.1</version>
|
|
<executions>
|
|
<execution>
|
|
<id>download-android-sdk</id>
|
|
<phase>generate-resources</phase>
|
|
<goals>
|
|
<goal>exec</goal>
|
|
</goals>
|
|
<configuration>
|
|
<executable>${project.basedir}/scripts/get-android.sh</executable>
|
|
<workingDirectory>${project.basedir}</workingDirectory>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<!--
|
|
Unpack android.jar into target/classes so SDK classes
|
|
are included in the final JAR alongside custom stubs
|
|
-->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
|
<version>3.1.0</version>
|
|
<executions>
|
|
<execution>
|
|
<id>unpack-android-jar</id>
|
|
<phase>process-resources</phase>
|
|
<goals>
|
|
<goal>run</goal>
|
|
</goals>
|
|
<configuration>
|
|
<target>
|
|
<echo message="Unpacking android.jar into target/classes..."/>
|
|
<unzip src="${project.build.directory}/android.jar"
|
|
dest="${project.build.outputDirectory}"
|
|
overwrite="false">
|
|
<patternset>
|
|
<exclude name="META-INF/*.SF"/>
|
|
<exclude name="META-INF/*.DSA"/>
|
|
<exclude name="META-INF/*.RSA"/>
|
|
<exclude name="AndroidManifest.xml"/>
|
|
<exclude name="NOTICES/**"/>
|
|
<exclude name="res/**"/>
|
|
<exclude name="assets/**"/>
|
|
<exclude name="resources.arsc"/>
|
|
<exclude name="org/json/**"/>
|
|
<exclude name="org/apache/http/**"/>
|
|
<!-- Strip JDK duplicates (android.jar shadows the JVM bootstrap classes) -->
|
|
<exclude name="java/**"/>
|
|
<exclude name="javax/**"/>
|
|
<exclude name="org/w3c/**"/>
|
|
<exclude name="org/xml/**"/>
|
|
<exclude name="dalvik/**"/>
|
|
</patternset>
|
|
</unzip>
|
|
<echo message="android.jar unpacked successfully"/>
|
|
</target>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
|
|
</project>
|