Skip to content

Commit

Permalink
Updating repo
Browse files Browse the repository at this point in the history
  • Loading branch information
SuppieRK committed Nov 5, 2023
1 parent 33a3320 commit 2e6de05
Show file tree
Hide file tree
Showing 71 changed files with 2,897 additions and 2,852 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
29 changes: 25 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,35 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 1.8

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build
- name: Publish to Bintray with Gradle
run: ./gradlew bintrayUpload -Dbintray.user=${{ secrets.BINTRAY_USER }} -Dbintray.key=${{ secrets.BINTRAY_KEY }}

- name: Publish to Maven Central
run: ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }}
62 changes: 0 additions & 62 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

21 changes: 18 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,33 @@ name: Java CI with Gradle for Pull Requests

on:
pull_request:
branches: [ master ]
branches-ignore:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up JDK 1.8
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 1.8

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 1.0.0

Initial release with set of functions and Try
Initial release with a set of Java functional interfaces and Try
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Roman Khlebnov
Copyright (c) 2023 Roman Khlebnov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Java Throwable Utils

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSuppieRK%2Fjava-throwable-utils.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSuppieRK%2Fjava-throwable-utils?ref=badge_shield)
[![Download](https://api.bintray.com/packages/suppierk/com.github.suppie/java-throwable-utils/images/download.svg)](https://bintray.com/suppierk/com.github.suppie/java-throwable-utils/_latestVersion)

This dependency-less library serves for one simple purpose - allow developer to invoke methods throwing exceptions in Java 8 functional expressions / Stream API

Expand Down Expand Up @@ -69,7 +68,7 @@ public class Test {
with this library you can simplify this pipeline to:

```java
import com.github.suppie.java.util.function.ThrowableConsumer;
import function.io.github.suppierk.java.util.ThrowableConsumer;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -94,7 +93,7 @@ All exceptions will be propagated as is using neat trick similar to Apache Commo
This library has simple implementation of `Try` monad, which benefits greatly from presence of these functions and allows us to handle exceptions in functional style much like you deal with nullable values using `Optional`

```java
import com.github.suppie.java.util.Try;
import io.github.suppierk.java.util.Try;

import java.util.ArrayList;
import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ This library has no dependencies on external libraries, which means that any sec

## Reporting a Vulnerability

In case if vulnerability is found, please, open an issue with detailed explanation of the vulnerability.
In case if a vulnerability is found, please, open an issue with the detailed explanation of the vulnerability.

Pull requests are always welcomed.
88 changes: 27 additions & 61 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
import java.nio.charset.StandardCharsets

plugins {
id 'java'
id 'java-library'

id 'idea'
id 'eclipse'

id 'jacoco'

id 'maven'
id 'maven-publish'
id 'com.jfrog.bintray' version "$BINTRAY_VERSION"
// Publishing
id 'com.vanniktech.maven.publish' version '0.25.3'

id 'com.diffplug.spotless' version '6.22.0'
}

description = 'Java 8 extensions allowing to use checked exceptions in functional programming API and adding Try monadic interface alongside with Optional'
// Project properties
group = "$GROUP"
version = "$VERSION_NAME"
description = "$POM_DESCRIPTION"

// Source code properties
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
compileJava.options.encoding = 'UTF-8'

// Enable Spotless code formatting rules
spotless {
java {
googleJavaFormat()
}

lineEndings = 'UNIX'
}

repositories {
mavenCentral()
}

dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:$JUNIT_VERSION"
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
}

test {
Expand All @@ -35,7 +51,6 @@ task sourceJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
}

javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
Expand All @@ -46,61 +61,12 @@ artifacts {
archives sourceJar
}

def pomConfig = {
licenses {
license {
name 'MIT License'
url 'https://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'SuppieRK'
name 'Roman Khlebnov'
email '[email protected]'
}
}
scm {
url "https://github.com/SuppieRK/${project.name}"
}
}

publishing {
publications {
maven(MavenPublication) {
groupId = "${project.group}"
artifactId = "${project.name}"
version = "${project.version}"
from project.components.java
artifact javadocJar
artifact sourceJar

pom.withXml {
def root = asNode()
root.appendNode('description', "${description}")
root.appendNode('name', "${project.name}")
root.appendNode('url', "https://github.com/SuppieRK/${project.name}")
root.children().last() + pomConfig
}
}
}
// Configure several tasks additionally for Gradle
tasks.withType(Copy).configureEach {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

bintray {
user = System.getProperty('bintray.user')
key = System.getProperty('bintray.key')
publications = ['maven']

pkg {
repo = "${project.group}"
name = "${project.name}"
licenses = ['MIT']
vcsUrl = "https://github.com/SuppieRK/${project.name}.git"
version {
name = "${project.version}"
desc = "${project.version}"
released = new Date()
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = StandardCharsets.UTF_8.name()
dependsOn(spotlessJavaCheck)
}
31 changes: 24 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# General project properties
group=com.github.suppie
version=1.0.0
# Plugin versions
BINTRAY_VERSION=1.8.5
# Library versions
JUNIT_VERSION=5.6.2
SONATYPE_HOST=S01
RELEASE_SIGNING_ENABLED=true
SONATYPE_AUTOMATIC_RELEASE=true

GROUP=io.github.suppierk
POM_ARTIFACT_ID=java-throwable-utils
VERSION_NAME=1.0.0

POM_NAME=Java Throwable Utilities
POM_DESCRIPTION=Java 8 compatible extensions allowing to use checked exceptions in functional programming APIs + Try interface
POM_INCEPTION_YEAR=2023
POM_URL=https://github.com/SuppieRK/java-throwable-utils

POM_LICENCE_NAME=MIT License
POM_LICENCE_URL=https://github.com/SuppieRK/java-throwable-utils/blob/master/LICENSE
POM_LICENCE_DIST=repo

POM_SCM_URL=https://github.com/SuppieRK/java-throwable-utils
POM_SCM_CONNECTION=scm:git:git://github.com/SuppieRK/java-throwable-utils.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/SuppieRK/java-throwable-utils.git

POM_DEVELOPER_ID=SuppieRK
POM_DEVELOPER_NAME=Roman Khlebnov
POM_DEVELOPER_URL=https://github.com/SuppieRK/
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 2e6de05

Please sign in to comment.