Support windows_dist & linux_dist for packaging (#2498)

* support windows_dist & linux_dist

* move plugins from profiles to pluginManagement

Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
This commit is contained in:
Lu Liu 2020-04-06 19:36:38 +08:00 committed by GitHub
parent da21c285ef
commit e26178e0b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 177 additions and 88 deletions

View File

@ -21,6 +21,80 @@
<mac.jre.path>/opt/jre1.8.0_181.jre</mac.jre.path>
</properties>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>sh.tak.appbundler</groupId>
<artifactId>appbundle-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>package-distributions</id>
<configuration>
<descriptors>
<descriptor>linux.xml</descriptor>
<descriptor>windows.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>linux</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>package-distributions</id>
<configuration>
<descriptors>
<descriptor>linux.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>windows</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>package-distributions</id>
<configuration>
<descriptors>
<descriptor>windows.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
@ -255,6 +329,66 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-antrun-plugin
</artifactId>
<versionRange>[1.4,)</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>package-distributions</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<!-- TBD -->
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>sh.tak.appbundler</groupId>
<artifactId>appbundle-maven-plugin</artifactId>
@ -277,7 +411,9 @@
<buildDirectory>target/OpenRefine ${project.version}</buildDirectory>
<iconFile>${icon.path}</iconFile>
<generateDiskImageFile>true</generateDiskImageFile>
<diskImageFile>${project.build.directory}/${project.build.finalName}-mac-${project.version}.dmg</diskImageFile>
<diskImageFile>
${project.build.directory}/${project.build.finalName}-mac-${project.version}.dmg
</diskImageFile>
<jvmVersion>1.8</jvmVersion>
<jrePath>${mac.jre.path}</jrePath>
<jvmOptions>
@ -322,67 +458,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>package-distributions</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>linux.xml</descriptor>
<descriptor>windows.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-antrun-plugin
</artifactId>
<versionRange>[1.4,)</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

16
refine
View File

@ -387,7 +387,21 @@ dist() {
get_version $1
mvn_prepare
"$MVN" versions:set -DnewVersion="$VERSION"
mvn package
"$MVN" package
}
windows_dist() {
get_version $1
mvn_prepare
"$MVN" versions:set -DnewVersion="$VERSION"
"$MVN" package -P windows
}
linux_dist() {
get_version $1
mvn_prepare
"$MVN" versions:set -DnewVersion="$VERSION"
"$MVN" package -P linux
}
# Kept just in case someone wants to follow this workflow on a mac,