Skip to content

Commit

Permalink
Version 1.0.5
Browse files Browse the repository at this point in the history
- Added Runnable overload for Applocker.Builder#onFail
- Removed Spotbugs and PMD
- pom.xml tweaks
  • Loading branch information
sanyarnd committed May 21, 2019
1 parent 64e1744 commit 7ad562f
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 39 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ install:
after_success:
- mvn org.jacoco:jacoco-maven-plugin:report
- mvn pvsstudio:pvsCredentials pvsstudio:pvsAnalyze
- mvn spotbugs:spotbugs
- mvn pmd:pmd
- mvn sonar:sonar -DskipTests=true -Dmaven.install.skip=true

# there is no deploy without tag (yet?),
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.0.5
- `Runnable` overload for `onFail` method
- Removed Spotbugs amd PMD
- pom.xml changes

# 1.0.4
- Nonnull by default for all API
- Spotbugs and PMD integration
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Maven:
<dependency>
<groupId>io.github.sanyarnd</groupId>
<artifactId>app-locker</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
</dependency>

<repositories>
Expand All @@ -68,7 +68,7 @@ Maven:
```
Gradle:
```gradle
compile 'io.github.sanyarnd:app-locker:1.0.4'
compile 'io.github.sanyarnd:app-locker:1.0.5'
repositories {
maven {
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions gh-pages/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ description: Provides file-based locking mechanism with inter-process communicat
show_downloads: true

github:
owner_name: Alexander Biryukov
jar_url: https://github.com/sanyarnd/applocker/releases
pom_url: https://bintray.com/sanya-rnd/maven-projects/applocker
api_url: https://sanyarnd.github.io/applocker/apidocs/index.html

google_analytics: "UA-140515150-1"
6 changes: 3 additions & 3 deletions gh-pages/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ <h2 id="project_tagline">{{ site.description | default: site.github.project_tagl

{% if site.show_downloads %}
<section id="downloads">
<a class="pom_download_link" href="{{ site.github.pom_url }}">Download this project as a Maven/Gradle dependency</a>
<a class="jar_download_link" href="{{ site.github.jar_url }}">Download this project as a .jar file</a>
<a class="api_download_link" href="{{ site.github.api_url }}">Download this project as a .jar file</a>
<a class="api_download_link" href="{{ site.github.api_url }}">Download this project as a .jar file</a>
<a class="jar_download_link" href="{{ site.github.jar_url }}">Download this project as a .jar file</a>
<a class="pom_download_link" href="{{ site.github.pom_url }}">Download this project as a Maven/Gradle dependency</a>
</section>
{% endif %}
</header>
Expand Down
33 changes: 2 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.sanyarnd</groupId>
<artifactId>app-locker</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
<url>https://sanyarnd.github.io/applocker/</url>
<packaging>jar</packaging>

Expand Down Expand Up @@ -39,8 +39,6 @@

<sonar.coverage.jacoco.xmlReportPaths>target/sonar-reports/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.pvs-studio.reportPath>target/sonar-reports/pvs-output.xml</sonar.pvs-studio.reportPath>
<sonar.java.spotbugs.reportPaths>target/sonar-reports/spotbugsXml.xml</sonar.java.spotbugs.reportPaths>
<sonar.java.pmd.reportPaths>target/sonar-reports/pmd.xml</sonar.java.pmd.reportPaths>

<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
Expand All @@ -60,11 +58,8 @@
<pvsstudio-maven-plugin.version>7.02.32034</pvsstudio-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.4</jacoco-maven-plugin.version>
<sonar-maven-plugin.version>3.6.0.1398</sonar-maven-plugin.version>
<maven-pmd-plugin.version>3.12.0</maven-pmd-plugin.version>
<maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
<checkstyle.version>8.20</checkstyle.version>
<spotbugs-maven-plugin.version>3.1.11</spotbugs-maven-plugin.version>
<spotbugs-findsec-maven-plugin.version>1.9.0</spotbugs-findsec-maven-plugin.version>

<lombok.version>1.18.8</lombok.version>
<jsr305.version>3.0.2</jsr305.version>
Expand Down Expand Up @@ -126,7 +121,7 @@
<goal>check</goal>
</goals>
<configuration>
<configLocation>checkstyle/checks.xml</configLocation>
<configLocation>checkstyle/checkstyle.xml</configLocation>
</configuration>
</execution>
</executions>
Expand All @@ -149,30 +144,6 @@
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs-maven-plugin.version}</version>
<configuration>
<spotbugsXmlOutputDirectory>target/sonar-reports</spotbugsXmlOutputDirectory>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>${spotbugs-findsec-maven-plugin.version}</version>
</plugin>
</plugins>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven-pmd-plugin.version}</version>
<configuration>
<targetDirectory>target/sonar-reports</targetDirectory>
<format>xml</format>
</configuration>
</plugin>
<plugin>
<groupId>com.pvsstudio</groupId>
<artifactId>pvsstudio-maven-plugin</artifactId>
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/io/github/sanyarnd/applocker/AppLocker.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public <T extends Serializable> Builder onBusy(final Serializable message, final
* @return builder
*/
public Builder onBusy(final Serializable message, final Runnable handler) {
busyHandler = (appLocker, ex) -> {
busyHandler = (appLocker, ignoredException) -> {
appLocker.sendMessage(message);
handler.run();
};
Expand All @@ -327,6 +327,18 @@ public Builder onFail(final Consumer<LockingException> handler) {
return this;
}

/**
* Defines an action in situations when locking is impossible.<br>
* Default value is identity function (re-throws exception).
*
* @param handler error processing function
* @return builder
*/
public Builder onFail(final Runnable handler) {
failedHandler = ignoredException -> handler.run();
return this;
}

/**
* Build AppLocker.
*
Expand Down

0 comments on commit 7ad562f

Please sign in to comment.