Skip to content

Commit

Permalink
Update of build scripts (#1740)
Browse files Browse the repository at this point in the history
* Removed the maven jgitver plugin and replaced them with mavens revision and changelist-feature.
* Updated all poms to use version from parameter instead.
* Removed unit tests that didn't test anything
* Moved junit, hamcrest and easymock to parent so that all modules have access to them
* Updated kotlin to a valid version (1.1.1 doesn't work in intellij anymore)
* Attempt to get travis script to read version from tag
  • Loading branch information
breiler committed Jan 9, 2022
1 parent fcae0eb commit c2dff23
Show file tree
Hide file tree
Showing 36 changed files with 146 additions and 334 deletions.
8 changes: 0 additions & 8 deletions .mvn/extensions.xml

This file was deleted.

1 change: 1 addition & 0 deletions .mvn/maven.config
@@ -0,0 +1 @@
-Djava.util.logging.config.file=scripts/logging.config
22 changes: 14 additions & 8 deletions .travis.yml
Expand Up @@ -21,16 +21,22 @@ before_script:
- curl -fL https://getcli.jfrog.io | sh

script:
- mvn test install -B -Djava.util.logging.config.file=scripts/logging.config
# Default to a snapshot build
- export REVISION="2.0"
- export CHANGELIST="-SNAPSHOT"
# If a travis tag was defined extract the version number and unset the snapshot
- if [[ $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then export REVISION=${TRAVIS_TAG:1}; export CHANGELIST=""; fi
# Build using the revision
- echo "Building version ${REVISION}${CHANGELIST}"
- mvn test install -B -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
- codecov
# Make sure artifacts can be built
- mvn package -pl ugs-classic assembly:assembly -DskipTests=true
- mvn package -pl ugs-platform/application -P create-autoupdate -DskipTests=true
- mvn package -pl ugs-platform/application -P create-macosx-package -DskipTests=true
- mvn package -pl ugs-platform/application -P create-win-package -DskipTests=true
- mvn package -pl ugs-platform/application -P create-linux-package -DskipTests=true
- mvn package -pl ugs-platform/application -P create-pi-package -DskipTests=true

- mvn package -pl ugs-classic assembly:assembly -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
- mvn package -pl ugs-platform/application -P create-autoupdate -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
- mvn package -pl ugs-platform/application -P create-macosx-package -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
- mvn package -pl ugs-platform/application -P create-win-package -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
- mvn package -pl ugs-platform/application -P create-linux-package -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}
- mvn package -pl ugs-platform/application -P create-pi-package -DskipTests=true -Drevision=${REVISION} -Dchangelist=${CHANGELIST}

deploy:
# Only deploy as nightly if master branch without tag
Expand Down
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -122,9 +122,7 @@ mvn package assembly:assembly

#### Develop via IntelliJ

If you are more used to IntelliJ, you can also build, run and debug it there.

Before you start you need to change a setting for handling imports in Maven since we are using `jgitver`, [read more about it here](https://github.com/jgitver/jgitver-maven-plugin/wiki/Intellij-IDEA-configuration).
If you are more used to IntelliJ, you can also build, run and debug it there.

- Run `mvn nbm:run-platform -pl ugs-platform/application` once via terminal to build everything
- Import the Source, `File` -> `New` -> `Project from existing Sources`
Expand Down
1 change: 0 additions & 1 deletion new-module-archetype/pom.xml
Expand Up @@ -4,7 +4,6 @@

<groupId>com.willwinder</groupId>
<artifactId>ugs-plugin-archetype</artifactId>
<version>2.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>

<name>ugs-plugin-archetype</name>
Expand Down
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.willwinder</groupId>
<artifactId>ugs-platform-parent</artifactId>
<version>2.0-SNAPSHOT</version>
<version>${revision}</version>
</parent>

<artifactId>${artifactId}</artifactId>
Expand Down Expand Up @@ -78,25 +78,6 @@
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-modules-settings</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependency>
</dependencies>
</project>
63 changes: 55 additions & 8 deletions pom.xml
Expand Up @@ -5,7 +5,7 @@

<groupId>com.willwinder.universalgcodesender</groupId>
<artifactId>ugs-parent</artifactId>
<version>2.0-SNAPSHOT</version>
<version>${revision}${changelist}</version>
<packaging>pom</packaging>

<inceptionYear>2012</inceptionYear>
Expand Down Expand Up @@ -35,6 +35,10 @@
</developers>

<properties>
<revision>2.0</revision>
<changelist>-SNAPSHOT</changelist>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jetty.version>9.4.17.v20190418</jetty.version>
<jersey.version>2.29.1</jersey.version>
<gluegen.version>2.3.2</gluegen.version>
Expand All @@ -57,6 +61,16 @@
<download-maven-plugin.version>1.3.0</download-maven-plugin.version>
<mockito.version>3.2.4</mockito.version>
<batik.version>1.14</batik.version>
<ugs.maven-resources-plugin.version>3.1.0</ugs.maven-resources-plugin.version>
<ugs.maven-jar-plugin.version>3.2.0</ugs.maven-jar-plugin.version>
<ugs.flatten-maven-plugin.version>1.2.2</ugs.flatten-maven-plugin.version>
<ugs.junit.version>4.13.2</ugs.junit.version>
<ugs.hamcrest-core.version>2.2</ugs.hamcrest-core.version>
<ugs.maven-shade-plugin.version>2.4.1</ugs.maven-shade-plugin.version>
<ugs.progressbar.version>0.7.2</ugs.progressbar.version>
<ugs.commons-cli.version>1.4</ugs.commons-cli.version>
<ugs.easymock.version>3.4</ugs.easymock.version>
<ugs.maven-assembly-plugin.version>2.5.3</ugs.maven-assembly-plugin.version>

<!-- Sets the timestamp format -->
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
Expand Down Expand Up @@ -166,6 +180,33 @@
<groupId>org.apache.maven.plugins</groupId>
<version>${ugs.surefire.version}</version>
</plugin>

<!-- For generating POM files with the revision number -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${ugs.flatten-maven-plugin.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand All @@ -183,7 +224,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>${ugs.junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -196,13 +237,19 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<version>${ugs.hamcrest-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.8.0</version>
<version>3.21.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>${ugs.easymock.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -235,7 +282,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -248,7 +295,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -263,7 +310,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -278,7 +325,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
2 changes: 1 addition & 1 deletion scripts/logging.config
@@ -1,2 +1,2 @@
handlers = java.util.logging.ConsoleHandler
.level=ERROR
.level=SEVERE
20 changes: 5 additions & 15 deletions ugs-classic/pom.xml
Expand Up @@ -5,11 +5,10 @@
<parent>
<groupId>com.willwinder.universalgcodesender</groupId>
<artifactId>ugs-parent</artifactId>
<version>2.0-SNAPSHOT</version>
<version>${revision}${changelist}</version>
</parent>

<artifactId>ugs-classic</artifactId>
<version>2.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand Down Expand Up @@ -39,16 +38,6 @@
<artifactId>ugs-cli</artifactId>
<version>${project.version}</version>
</dependency>

<!-- ************************* -->
<!-- *** TEST dependencies ***-->

<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.4</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -63,7 +52,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<version>${ugs.maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
Expand All @@ -78,7 +67,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<version>${ugs.maven-shade-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -95,6 +84,7 @@
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>module-info.*</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
Expand All @@ -110,7 +100,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<version>${ugs.maven-assembly-plugin.version}</version>
<configuration>
<finalName>UniversalGcodeSender</finalName>
<appendAssemblyId>false</appendAssemblyId>
Expand Down
16 changes: 4 additions & 12 deletions ugs-cli/pom.xml
Expand Up @@ -5,29 +5,21 @@
<parent>
<groupId>com.willwinder.universalgcodesender</groupId>
<artifactId>ugs-parent</artifactId>
<version>2.0-SNAPSHOT</version>
<version>${revision}${changelist}</version>
</parent>

<artifactId>ugs-cli</artifactId>
<version>2.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
<description>Universal Gcode Sender terminal client</description>
<url>https://github.com/winder/Universal-G-Code-Sender/tree/master/ugs-terminal-client</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.releaseSourceDirectory>release_files</project.build.releaseSourceDirectory>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
<version>${ugs.commons-cli.version}</version>
</dependency>
<dependency>
<groupId>com.willwinder.universalgcodesender</groupId>
Expand All @@ -42,7 +34,7 @@
<dependency>
<groupId>me.tongfei</groupId>
<artifactId>progressbar</artifactId>
<version>0.7.2</version>
<version>${ugs.progressbar.version}</version>
</dependency>
</dependencies>

Expand All @@ -67,7 +59,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<version>${ugs.maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
Expand Down
19 changes: 1 addition & 18 deletions ugs-core/pom.xml
Expand Up @@ -5,11 +5,10 @@
<parent>
<groupId>com.willwinder.universalgcodesender</groupId>
<artifactId>ugs-parent</artifactId>
<version>2.0-SNAPSHOT</version>
<version>${revision}${changelist}</version>
</parent>

<artifactId>ugs-core</artifactId>
<version>2.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand All @@ -24,11 +23,6 @@
</properties>

<dependencies>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-client-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
Expand Down Expand Up @@ -111,17 +105,6 @@
<artifactId>core</artifactId>
<version>${zxing.version}</version>
</dependency>


<!-- ************************* -->
<!-- *** TEST dependencies ***-->

<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.4</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down

0 comments on commit c2dff23

Please sign in to comment.