-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: spotless, google java-format, github-actions (#6)
* Version 0.6.0-SNAPSHOT * Adding spotless-plugin and google java-format * License-header fix * CI fix * CI fix * CI fix
- Loading branch information
1 parent
77e2b8d
commit c74fefb
Showing
26 changed files
with
990 additions
and
880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [kagkarlsson] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: build | ||
on: [push,pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ '11', '17' ] | ||
name: Temurin ${{ matrix.java }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Java ${{ matrix.java }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Run all tests | ||
run: mvn -B clean test --file pom.xml | ||
env: | ||
TZ: UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: "Validate PR title" | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: pull-request-check | ||
on: [pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ '17' ] | ||
name: Temurin ${{ matrix.java }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Java ${{ matrix.java }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Run all tests | ||
run: mvn -B spotless:check | ||
env: | ||
TZ: UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Copyright (C) Gustav Karlsson | ||
|
||
<p>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 | ||
|
||
<p>http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
<p>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. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 25 additions & 27 deletions
52
src/main/java/com/github/kagkarlsson/jdbc/DataSourceConnectionSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,43 @@ | ||
/** | ||
* Copyright (C) Gustav Karlsson | ||
* | ||
* 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 | ||
* <p>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 | ||
* <p>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 | ||
* <p>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.github.kagkarlsson.jdbc; | ||
|
||
import javax.sql.DataSource; | ||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
import javax.sql.DataSource; | ||
|
||
public class DataSourceConnectionSupplier implements ConnectionSupplier { | ||
private DataSource dataSource; | ||
private boolean commitWhenAutocommitDisabled; | ||
private DataSource dataSource; | ||
private boolean commitWhenAutocommitDisabled; | ||
|
||
public DataSourceConnectionSupplier(DataSource dataSource, boolean commitWhenAutocommitDisabled) { | ||
this.dataSource = dataSource; | ||
this.commitWhenAutocommitDisabled = commitWhenAutocommitDisabled; | ||
} | ||
public DataSourceConnectionSupplier(DataSource dataSource, boolean commitWhenAutocommitDisabled) { | ||
this.dataSource = dataSource; | ||
this.commitWhenAutocommitDisabled = commitWhenAutocommitDisabled; | ||
} | ||
|
||
@Override | ||
public Connection getConnection() throws SQLException { | ||
return dataSource.getConnection(); | ||
} | ||
@Override | ||
public Connection getConnection() throws SQLException { | ||
return dataSource.getConnection(); | ||
} | ||
|
||
@Override | ||
public boolean commitWhenAutocommitDisabled() { | ||
return commitWhenAutocommitDisabled; | ||
} | ||
@Override | ||
public boolean commitWhenAutocommitDisabled() { | ||
return commitWhenAutocommitDisabled; | ||
} | ||
|
||
@Override | ||
public boolean isExternallyManagedConnection() { | ||
return false; | ||
} | ||
@Override | ||
public boolean isExternallyManagedConnection() { | ||
return false; | ||
} | ||
} |
16 changes: 7 additions & 9 deletions
16
src/main/java/com/github/kagkarlsson/jdbc/DoInTransaction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
/** | ||
* Copyright (C) Gustav Karlsson | ||
* | ||
* 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 | ||
* <p>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 | ||
* <p>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 | ||
* <p>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.github.kagkarlsson.jdbc; | ||
|
||
import java.sql.Connection; | ||
|
||
public interface DoInTransaction<T> { | ||
T doInTransaction(Connection c); | ||
T doInTransaction(Connection c); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.