Add pom.xml and custom replacements

This commit is contained in:
Andrea Cavalli 2020-10-10 00:18:33 +02:00
parent 902f1c80a1
commit eeec132f99
8 changed files with 126 additions and 0 deletions

99
pom.template.xml Normal file
View File

@ -0,0 +1,99 @@
<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>
<groupId>it.tdlight</groupId>
<artifactId>tdlight-natives-${OPERATING_SYSTEM_NAME}-${CPU_ARCHITECTURE_NAME}</artifactId>
<version>3.0.0-${IMPLEMENTATION_NAME}-SNAPSHOT</version>
<name>TDLight Natives for Windows (amd64)</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<distributionManagement>
<repository>
<id>mchv-release-distribution</id>
<name>MCHV Release Apache Maven Packages Distribution</name>
<url>https://mvn.mchv.eu/repository/mchv</url>
</repository>
<snapshotRepository>
<id>mchv-snapshot-distribution</id>
<name>MCHV Snapshot Apache Maven Packages Distribution</name>
<url>https://mvn.mchv.eu/repository/mchv-snapshot</url>
</snapshotRepository>
</distributionManagement>
<scm>
<url>https://git.ignuranza.net/tdlight-team/tdlight-java-natives.git</url>
<connection>scm:git:https://git.ignuranza.net/tdlight-team/tdlight-java-natives.git</connection>
<developerConnection>scm:git:https://git.ignuranza.net/tdlight-team/tdlight-java-natives.git</developerConnection>
<tag>HEAD</tag>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<pomFileName>${project.name}/pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>it.tdlight.jni.operating_system_name.cpu_architecture_name.implementation_name</pattern>
<shadedPattern>it.tdlight.jni.${OPERATING_SYSTEM_NAME}.${CPU_ARCHITECTURE_NAME}.${IMPLEMENTATION_NAME}</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,9 @@
package it.tdlight.jni.operating_system_name.cpu_architecture_name.implementation_name;
import java.lang.ClassLoader;
public class LoadLibrary {
public static ClassLoader getClassLoader() {
return LoadLibrary.class.getClassLoader();
}
}

View File

@ -0,0 +1,3 @@
s/${OPERATING_SYSTEM_NAME}/linux/
s/${CPU_ARCHITECTURE_NAME}/aarch64/
s/${IMPLEMENTATION_NAME}/tdlib/

View File

@ -0,0 +1,3 @@
s/${OPERATING_SYSTEM_NAME}/linux/
s/${CPU_ARCHITECTURE_NAME}/aarch64/
s/${IMPLEMENTATION_NAME}/tdlight/

View File

@ -0,0 +1,3 @@
s/${OPERATING_SYSTEM_NAME}/linux/
s/${CPU_ARCHITECTURE_NAME}/amd64/
s/${IMPLEMENTATION_NAME}/tdlib/

View File

@ -0,0 +1,3 @@
s/${OPERATING_SYSTEM_NAME}/linux/
s/${CPU_ARCHITECTURE_NAME}/amd64/
s/${IMPLEMENTATION_NAME}/tdlight/

View File

@ -0,0 +1,3 @@
s/${OPERATING_SYSTEM_NAME}/windows/
s/${CPU_ARCHITECTURE_NAME}/amd64/
s/${IMPLEMENTATION_NAME}/tdlib/

View File

@ -0,0 +1,3 @@
s/${OPERATING_SYSTEM_NAME}/windows/
s/${CPU_ARCHITECTURE_NAME}/amd64/
s/${IMPLEMENTATION_NAME}/tdlight/