Skip to content

Commit

Permalink
Merge pull request #60
Browse files Browse the repository at this point in the history
Rc/v2.0.2
  • Loading branch information
benchdoos authored Oct 30, 2023
2 parents a186722 + 5d37b5f commit 5973370
Show file tree
Hide file tree
Showing 17 changed files with 486 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
cd weblocopenercore
ls -a
mvn -B clean install -P hide-ultimate-mode
mvn -B clean install -P hide-ultimate-mode,check-dependencies
- name: Get commit hash for WeblocOpenerCore
id: weblocopenercore_hash
Expand All @@ -62,7 +62,7 @@ jobs:
echo WeblocOpenerCore hash: $WEBLOCOPENER_HASH
- name: Build WeblocOpener
run: mvn -B clean package -P build-setup,build-deb,build-exe --file pom.xml
run: mvn -B clean package -P build-setup,build-deb,build-exe,check-dependencies --file pom.xml

- name: Get commit hash for WeblocOpener
id: weblocopener_hash
Expand Down
18 changes: 12 additions & 6 deletions build/WeblocOpener.iss
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,19 @@ begin
Log(Format('Extracted version: %s', [S]));
{ extract major }
if Copy(S, 1, 2) = '1.' then
begin
if Copy(S, 1, 2) = '1.' then
begin
Delete(S, 1, 2)
end;
P := Pos('.', S);
SetLength(S, P - 1);
Log(Format('Major version: %s', [S]));
end;
P := Pos('.', S);
Log(Format('Dot position: %d', [P]));
if (P <> 0) then
begin
SetLength(S, P - 1);
end;
Log(Format('Major version: %s', [S]));
Result := StrToIntDef(S, 0);
end;
Expand Down
167 changes: 155 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<weblocopener.core.version>2.0.1</weblocopener.core.version>
<weblocopener.core.version>2.0.2</weblocopener.core.version>
<copyright>Copyright © 2016-2023 Eugene Zrazhevsky</copyright>
<org.mapstruct.version>1.5.3.Final</org.mapstruct.version>
<lombok.version>1.18.26</lombok.version>
<lombok.version>1.18.30</lombok.version>

<disable.dev_mode>true</disable.dev_mode>
<ultimate_build>false</ultimate_build>
Expand All @@ -53,6 +53,20 @@

<application.mainClass>com.github.benchdoos.weblocopener.Main</application.mainClass>
<log4j.version>2.17.2</log4j.version>
<wiremock.version>3.0.1</wiremock.version>
<mockito-junit-jupiter.version>4.5.1</mockito-junit-jupiter.version>
<junit-jupiter.version>5.9.2</junit-jupiter.version>
<easy-random.version>5.0.0</easy-random.version>
<assertj-core.version>3.24.2</assertj-core.version>
<jackson-databind.version>2.15.3</jackson-databind.version>
<commons-lang3.version>3.13.0</commons-lang3.version>
<j2html.version>1.6.0</j2html.version>
<commons-collections4.version>4.4</commons-collections4.version>
<commons-validator.version>1.7</commons-validator.version>
<annotations.version>23.0.0</annotations.version>
<bridj.version>0.7.0</bridj.version>
<forms_rt.version>7.0.3</forms_rt.version>
<jdom2.version>2.0.6.1</jdom2.version>
</properties>

<scm>
Expand Down Expand Up @@ -130,6 +144,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
Expand All @@ -139,6 +154,7 @@
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<includeScope>runtime</includeScope>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
Expand Down Expand Up @@ -312,10 +328,10 @@
</outfile>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl>https://adoptium.net/temurin/releases/
<downloadUrl>
https://adoptium.net/marketplace/?arch=any&amp;package=jre&amp;version=17
</downloadUrl>
<supportUrl>https://github.com/benchdoos/WeblocOpener/issues
</supportUrl>
<supportUrl>https://github.com/benchdoos/WeblocOpener/issues</supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<icon>
Expand Down Expand Up @@ -420,20 +436,81 @@
</plugins>
</build>
</profile>
<profile>
<id>check-dependencies</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
<requireUpperBoundDeps>
<!-- 'uniqueVersions' (default:false) can be set to true if you want to compare the timestamped SNAPSHOTs -->
<!-- <uniqueVersions>true</uniqueVersions> -->
<!-- If you wish to ignore certain cases:
<excludes>
<exclude>com.google.guava:guava</exclude>
</excludes>
-->
<!-- If you include specific cases only these will be checked: (when omitted everything is included)
<includes>
<include>com.google.guava:guava</include>
</includes>
-->
<!-- only artifacts with provided scope will be excluded
<excludedScopes>
<excludedScope>provided</excludedScopes>
</excludedScopes>
-->
</requireUpperBoundDeps>
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>
<dependency>
<groupId>com.github.benchdoos</groupId>
<artifactId>WeblocOpenerCore</artifactId>
<version>${weblocopener.core.version}</version>
<exclusions>
<exclusion>
<artifactId>httpclient</artifactId>
<groupId>org.apache.httpcomponents</groupId>
</exclusion>
</exclusions>
</dependency>

<!--Intellij Forms-->

<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>${jdom2.version}</version>
</dependency>
<dependency>
<groupId>com.intellij</groupId>
<artifactId>forms_rt</artifactId>
<version>7.0.3</version>
<version>${forms_rt.version}</version>
<exclusions>
<exclusion>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
</exclusion>
</exclusions>
</dependency>

<!--Logging-->
Expand All @@ -454,41 +531,107 @@
<dependency>
<groupId>com.nativelibs4java</groupId>
<artifactId>bridj</artifactId>
<version>0.7.0</version>
<version>${bridj.version}</version>
</dependency>

<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
<version>${annotations.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons-collections4.version}</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.7</version>
<version>${commons-validator.version}</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.j2html</groupId>
<artifactId>j2html</artifactId>
<version>1.6.0</version>
<version>${j2html.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-databind.version}</version>
<scope>compile</scope>
</dependency>

<!--Tests-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.2</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito-junit-jupiter.version}</version>
<exclusions>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<version>${wiremock.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jeasy</groupId>
<artifactId>easy-random-core</artifactId>
<version>${easy-random.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>


</dependencies>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ serverApplicationVersion, new CoreUtils().getCurrentAppVersion())
new CoreUtils().getCurrentAppVersion(),
serverApplicationVersion);
}
} else onNewVersionAvailable();
} else {
log.warn("Dev mode is active, showing message, new version is available");
onNewVersionAvailable();
}
}

private void onNewVersionAvailable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
import com.github.benchdoos.weblocopenercore.service.translation.Translation;
import j2html.TagCreator;
import j2html.tags.specialized.HtmlTag;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;

@Log4j2
public class DefaultHtmlService implements Serializable, HtmlService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
import com.github.benchdoos.weblocopenercore.service.actions.ActionListenerSupport;
import lombok.Getter;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Files;
import org.apache.commons.collections4.CollectionUtils;

import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicReference;
Expand Down Expand Up @@ -136,7 +136,7 @@ public void startUpdate(AppVersion appVersion) throws IOException {
}
}
} else {
Files.delete(installerFile);
Files.delete(installerFile.toPath());
updateAndInstall(installerAsset, installerFile);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.github.benchdoos.weblocopenercore.exceptions.NoAvailableVersionException;
import lombok.Getter;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;

import java.io.File;
import java.io.IOException;
Expand Down
Loading

0 comments on commit 5973370

Please sign in to comment.