Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermocalvo committed May 31, 2024
2 parents cd6ce16 + 6ce25cf commit cb91582
Show file tree
Hide file tree
Showing 36 changed files with 432 additions and 30 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,26 @@ jobs:
matrix:
jdk: [ 11, 17, 21 ]

env:
is_latest_jdk: ${{ matrix.jdk == 21 && 'yes' || '' }}
is_main: ${{ github.ref_name == github.event.repository.default_branch && 'yes' || '' }}
is_develop: ${{ github.ref_name == 'develop' && 'yes' || '' }}
is_fork: ${{ github.event_name == 'pull_request' && 'yes' || '' }}

steps:

# ================================
# SHALLOW CLONE
# ================================
- name: Shallow clone
if: ${{ matrix.jdk != 21 || github.event_name != 'push' }}
if: ${{ !env.is_latest_jdk || env.is_fork }}
uses: actions/checkout@v4

# ================================
# CHECKOUT
# ================================
- name: Checkout git branch
if: ${{ matrix.jdk == 21 && github.event_name == 'push' }}
if: ${{ env.is_latest_jdk && !env.is_fork }}
uses: actions/checkout@v4
with:
# Fetch all history for all tags and branches (recommended by SonarQube)
Expand All @@ -44,7 +50,7 @@ jobs:
# VALIDATE GRADLE WRAPPER
# ================================
- name: Validate Gradle Wrapper files
if: ${{ matrix.jdk == 21 }}
if: ${{ env.is_latest_jdk }}
uses: gradle/actions/wrapper-validation@v3

# ================================
Expand All @@ -66,7 +72,7 @@ jobs:
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
build-scan-terms-of-use-agree: "yes"
cache-read-only: ${{ github.event_name != 'push' }}
cache-read-only: ${{ !env.is_main && !env.is_develop }}

# ================================
# EXPORT GRADLE PROPERTIES
Expand All @@ -82,13 +88,13 @@ jobs:
# BUILD
# ================================
- name: Build version ${{ steps.properties.outputs.version }}
run: ./gradlew build -x check --info
run: ./gradlew build -x check

# ================================
# CHECK
# ================================
- name: Check
run: ./gradlew check --info
run: ./gradlew check

# ================================
# COMPATIBILITY REPORT
Expand All @@ -101,7 +107,7 @@ jobs:
# CACHE SONARCLOUD PACKAGES
# ================================
- name: Cache SonarCloud packages
if: ${{ matrix.jdk == 21 && github.event_name == 'push' }}
if: ${{ env.is_latest_jdk && !env.is_fork }}
uses: actions/cache@v4
with:
key: ${{ runner.os }}-sonar
Expand All @@ -114,21 +120,21 @@ jobs:
# ANALYZE WITH SONARCLOUD
# ================================
- name: Analyze with SonarCloud
if: ${{ matrix.jdk == 21 && github.event_name == 'push' }}
if: ${{ env.is_latest_jdk && !env.is_fork }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io
SONAR_ORGANIZATION: leakyabstractions
run: ./gradlew sonarqube --info
run: ./gradlew sonar

# ================================
# PUBLISH SNAPSHOT
# ================================
- name: Publish snapshot version ${{ steps.properties.outputs.version }}
if: ${{ matrix.jdk == 21 && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch && endsWith(steps.properties.outputs.version, '-SNAPSHOT') }}
if: ${{ env.is_latest_jdk && !env.is_fork && env.is_main && endsWith(steps.properties.outputs.version, '-SNAPSHOT') }}
env:
ORG_GRADLE_PROJECT_githubUsername: ${{ secrets.PUBLISH_USERNAME }}
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.PUBLISH_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
run: ./gradlew publish -Psnapshot --info
run: ./gradlew publish -Psnapshot
3 changes: 3 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ jobs:
# ================================
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v3
env:
# Exclude dependencies that are only resolved in test classpaths
DEPENDENCY_GRAPH_EXCLUDE_CONFIGURATIONS: '.*[Tt]est(Compile|Runtime)Classpath'
2 changes: 1 addition & 1 deletion .github/workflows/update-gradle-wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
uses: gradle-update/update-gradle-wrapper-action@v1
with:
release-channel: stable
base-branch: main
base-branch: develop
target-branch: develop
16 changes: 16 additions & 0 deletions .licenseheader
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

4 changes: 2 additions & 2 deletions badge.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"style": "flat",
"labelColor": "fff",
"color": "light-green",
"label": "Result",
"label": "result-lazy",
"message": "{{ site.current_version }}",
"logoSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' role='img'><path fill='#000' d='m128 0c-70.692496 0-128 57.307556-128 128 0 70.69245 57.307504 128 128 128 70.6925 0 128-57.30755 128-128 0-70.692444-57.3075-128-128-128z'/><path fill='#fff' d='m136.35564 57.292727-40.67397-13.292725-23.68167 75.404758 10.5988 3.14252 10.03853-31.546757 25.76122 7.912145 3.29783 7.051312-8.19024 24.69695 10.51558 3.34618 9.44724-28.93646-3.77957-8.198802 7.87469-4.149675 6.69237-21.031168zm-7.41926 8.851265 3.54748 6.440357-3.80826 12.228035-6.84766 3.38107-26.04807-7.791706 7.15442-22.743615zm-17.85826-43.378365c38.23512 0 69.22657 30.999275 69.22657 69.234375 0 38.235098-30.99145 69.234378-69.22657 69.234378-38.23513 0-69.23437-30.99928-69.23437-69.234378 0-38.2351 30.99924-69.234375 69.23437-69.234375z'/></svg>"
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description = Lazy Result Library for Java
group = com.leakyabstractions
artifactName = Lazy Result Library
artifactId = result-lazy
version = 0.6.0.1
version = 0.6.1.0-SNAPSHOT
previousVersion = 0.6.0.0

homepage = https://dev.leakyabstractions.com/result-lazy/
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
assertj = "3.25.3"
assertj = "3.26.0"
google-java-format = "1.19.2"
jacoco = "0.8.10"
japicmp = "0.4.2"
junit = "5.10.2"
nexus-publish = "2.0.0"
result-api = "0.1.0.3"
result-core = "0.15.0.1"
result-assertj = "0.9.1.0"
result-api = "0.1.0.4"
result-core = "0.15.1.1"
result-assertj = "0.9.3.0"
sonarqube = "5.0.0.4638"
spotless = "6.25.0"

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
1 change: 1 addition & 0 deletions result-lazy/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ spotless {
googleJavaFormat(googleJavaFormatVersion)
eclipse().configFile rootProject.file('.formatting.xml')
importOrderFile rootProject.file('.importorder')
licenseHeaderFile rootProject.file('.licenseheader')
targetExclude("**/example/*.java")
removeUnusedImports()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.leakyabstractions.result.lazy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.leakyabstractions.result.lazy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.leakyabstractions.result.lazy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.leakyabstractions.result.lazy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.leakyabstractions.result.lazy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.leakyabstractions.result.lazy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.leakyabstractions.result.lazy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.leakyabstractions.result.lazy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2024 Guillermo Calvo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.leakyabstractions.result.lazy;

Expand Down
Loading

0 comments on commit cb91582

Please sign in to comment.