Skip to content

Commit

Permalink
Deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
williamniemiec committed Aug 12, 2021
0 parents commit d6cfd4a
Show file tree
Hide file tree
Showing 8 changed files with 996 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Project
.settings/
*.iml
.idea/

# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compilation folders
obj/
bin/

#MacOS Files
.DS_Store

#CLion Files
.idea/

# Visual code
.vscode

# CMake
*cmake-build-*/
*CMakeLists.txt

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 William Niemiec

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
![](https://github.com/wniemiec-task-java/scheduler/blob/master/docs/img/logo/logo.jpg)

<h1 align='center'>Scheduler</h1>
<p align='center'>Schedule routines to run after a certain time or whenever the the timer expires.</p>
<p align="center">
<a href="https://github.com/wniemiec-task-java/scheduler/actions/workflows/windows.yml"><img src="https://github.com/wniemiec-task-java/scheduler/actions/workflows/windows.yml/badge.svg" alt=""></a>
<a href="https://github.com/wniemiec-task-java/scheduler/actions/workflows/macos.yml"><img src="https://github.com/wniemiec-task-java/scheduler/actions/workflows/macos.yml/badge.svg" alt=""></a>
<a href="https://github.com/wniemiec-task-java/scheduler/actions/workflows/ubuntu.yml"><img src="https://github.com/wniemiec-task-java/scheduler/actions/workflows/ubuntu.yml/badge.svg" alt=""></a>
<a href="https://codecov.io/gh/wniemiec-task-java/scheduler"><img src="https://codecov.io/gh/wniemiec-task-java/scheduler/branch/master/graph/badge.svg?token=R2SFS4SP86" alt="Coverage status"></a>
<a href="http://java.oracle.com"><img src="https://img.shields.io/badge/java-11+-D0008F.svg" alt="Java compatibility"></a>
<a href="https://mvnrepository.com/artifact/io.github.wniemiec-task-java/scheduler"><img src="https://img.shields.io/maven-central/v/io.github.wniemiec-task-java/scheduler" alt="Maven Central release"></a>
<a href="https://github.com/wniemiec-task-java/scheduler/blob/master/LICENSE"><img src="https://img.shields.io/github/license/wniemiec-task-java/scheduler" alt="License"></a>
</p>
<hr />

## ❇ Introduction
Scheduler allows you to perform operations with routines so that they are executed according to a criterion.

## ❓ How to use
1. Add one of the options below to the pom.xml file:

#### Using Maven Central (recomended):
```
<dependency>
<groupId>io.github.wniemiec-task-java</groupId>
<artifactId>scheduler</artifactId>
<version>LATEST</version>
</dependency>
```

#### Using GitHub Packages:
```
<dependency>
<groupId>wniemiec.task.java</groupId>
<artifactId>scheduler</artifactId>
<version>LATEST</version>
</dependency>
```

2. Run
```
$ mvn install
```

3. Use it
```
[...]
import wniemiec.task.java.Scheduler;
[...]
Scheduler.setTimeout(() -> { System.out.println("Hello..."); }, 1000);
Scheduler.setTimeout(() -> { System.out.println("World!"); }, 1000);
```

## 📖 Documentation
| Property |Parameter type|Return type|Description|Default parameter value|
|----------------|-------------------------------|-----------------------------|--------|
|setTimeout |`routine: Routine, delay: long`|`long`|Sets a timer which executes a routine once the timer expires| - |
|setInterval |`routine: Routine, delay: long`|`long`|Repeatedly calls a routine with a fixed time delay between each call| - |
|clearInterval |`id: long`|`void`|Cancels a timed, repeating action| - |
|clearTimeout |`id: long`|`void`|Cancels a timed action| - |
|clearAllTimeout | `void`|`void`|Clear all timeouts| - |
|clearAllIntervals | `void`|`void`|Clear all intervals| - |
|setTimeoutToRoutine|`routine: Routine, delay: long`|`long`|Runs a routine within a timeout. If the routine does not end on time, an interrupt signal will be sent to it| - |

## 🚩 Changelog
Details about each version are documented in the [releases section](https://github.com/williamniemiec/wniemiec-task-java/scheduler/releases).

## 🤝 Contribute!
See the documentation on how you can contribute to the project [here](https://github.com/wniemiec-task-java/scheduler/blob/master/CONTRIBUTING.md).

## 📁 Files

### /
| Name |Type|Description|
|----------------|-------------------------------|-----------------------------|
|dist |`Directory`|Released versions|
|docs |`Directory`|Documentation files|
|src |`Directory`| Source files|
Binary file added dist/1.x/scheduler-1.0.0.jar
Binary file not shown.
212 changes: 212 additions & 0 deletions pom-mavencentral.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="UTF-8"?>

<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>io.github.wniemiec-task-java</groupId>
<artifactId>scheduler</artifactId>
<version>1.0.0</version>

<name>Checkpoint</name>
<description>Schedule routines to run after a certain time or whenever the the timer expires.</description>
<url>https://github.com/wniemiec-task-java/scheduler</url>

<properties>
<version.major>1</version.major>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.source-target.version>11</java.source-target.version>
</properties>

<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>

<developers>
<developer>
<id>williamniemiec</id>
<name>William Niemiec</name>
<email>[email protected]</email>
</developer>
</developers>

<scm>
<connection>scm:git:[email protected]:wniemiec-task-java/scheduler.git</connection>
<developerConnection>scm:git:ssh://github.com:wniemiec-task-java/scheduler.git</developerConnection>
<url>https://github.com/wniemiec-task-java/scheduler/tree/main</url>
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
</resources>

<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>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${java.source-target.version}</source>
<target>${java.source-target.version}</target>
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<outputDirectory>${project.build.directory}/../dist/${version.major}.x</outputDirectory>
</configuration>
</plugin>

<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>

<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>

<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Coverage -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
<executions>
<execution>
<id>jacoco-initialize</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>ci-cd</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- Prevent gpg from using pinentry programs. Fixes: gpg: signing
failed: Inappropriate ioctl for device -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading

0 comments on commit d6cfd4a

Please sign in to comment.