Skip to content

Commit

Permalink
build system changed to maven and other refactoring
Browse files Browse the repository at this point in the history
1. Android example moved to a different repo
2. Replication module deprecated and removed
3. NitriteMapper api changed
4. Version upgraded to 4.2.0-SNAPSHOT
  • Loading branch information
anidotnet committed Aug 5, 2023
1 parent 94926af commit f84e5f7
Show file tree
Hide file tree
Showing 542 changed files with 11,281 additions and 13,323 deletions.
7 changes: 0 additions & 7 deletions .ci/build.sh

This file was deleted.

26 changes: 0 additions & 26 deletions .ci/prepare-travis.sh

This file was deleted.

4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ insert_final_newline = false
indent_style = space
indent_size = 4

[{.babelrc, .stylelintrc, .eslintrc, *.bowerrc, *.jsb3, *.jsb2, *.schema, *.json}]
indent_style = space
indent_size = 2

[{*.ddl, *.sql}]
indent_style = space
indent_size = 2
Expand Down
3 changes: 1 addition & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#open_collective: nitrite-database
github: anidotnet
github: anidotnet
10 changes: 3 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
version: 2
updates:
- package-ecosystem: gradle
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
target-branch: develop
ignore:
- dependency-name: org.objenesis:objenesis
versions:
- "> 2.6"
target-branch: main

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
target-branch: develop
target-branch: main
84 changes: 44 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,81 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: "Build"
name: Build

on:
push:
branches:
- 4.x
- main
- develop

- release
paths-ignore:
- "README.md"
pull_request:
branches:
- 4.x
- main
- develop
- release
paths-ignore:
- "README.md"

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '11' ]
java: ['11', '17']
os: ['ubuntu-latest']
env:
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
GITHUB_TOKEN: ${{ secrets.NITRITE_GH_TOKEN }}
name: Build with Java ${{ matrix.Java }}

steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.Java }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.Java }}
java-package: jdk
architecture: x64

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

- name: Build with Gradle
run: ./gradlew clean build
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}
name: Build with Java ${{ matrix.java }} on ${{ matrix.os }}

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java
- name: Set up JDK ${{ matrix.java }} on ${{ matrix.os }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
java-version: '11'
java-package: jdk
architecture: x64

- name: Grant execute permission for gradlew
run: chmod +x gradlew
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Prepare PGP Keys
if: github.ref == 'refs/heads/develop'
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/release'
run: openssl aes-256-cbc -pass pass:$PGP_KEY_PASSWORD -in ./.ci/secring.gpg.enc -out $GITHUB_WORKSPACE/secring.gpg -d -md md5
env:
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}

- name: Publish packages to snapshot
- name: Build with Maven
run: mvn -B -ff -ntp clean install

- name: Deploy Snapshot
if: github.ref == 'refs/heads/develop'
run: ./gradlew publish -Psigning.keyId=$PGP_KEY_ID -Psigning.password=$PGP_KEY_PASSWORD -Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/secring.gpg
run: mvn -B -ff -ntp deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}

- name: Deploy Release
if: github.ref == 'refs/heads/release'
run: mvn -B -ff -ntp release:clean release:prepare release:perform -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.NITRITE_GH_TOKEN }}

- name: Publish Code Coverage
if: github.ref == 'refs/heads/release'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
name: codecov-umbrella
62 changes: 31 additions & 31 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@ jobs:
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
20 changes: 0 additions & 20 deletions .github/workflows/codesee-arch-diagram.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
tasks:
- init: ./gradlew clean build
- init: mvn clean install
10 changes: 10 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

19 changes: 5 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,19 @@ below.
Bug Fixes and New Features
--------------------------

Before starting to write code, look for existing [issues](https://github.com/dizitart/nitrite-database/issues) or
[create one](https://github.com/dizitart/nitrite-database/issues/new) for your bug, issue, or feature request. This helps the community
Before starting to write code, look for existing [issues](https://github.com/nitrite/nitrite-java/issues) or
[create one](https://github.com/nitrite/nitrite-java/issues/new) for your bug, issue, or feature request. This helps the community
avoid working on something that might not be of interest or which has already been addressed.

Pull Requests
-------------

Pull requests should generally be made against the master (default) branch and include relevant tests, if applicable.

Code should compile and tests should pass under all Java versions that Nitrite supports. Currently Nitrite supports a minimum version of Java 8.
Please run './gradlew test' to confirm. By default, running the tests requires

* that you started a mongod server on localhost, listening on the default port and and ran below command to configure the test user

db.getSiblingDB('benchmark').createUser({user: 'bench', pwd: 'bench', roles: [{role: 'readWrite', db: 'benchmark'}, {role: 'dbAdmin', db: 'benchmark'}]})

* that you have installed Android SDK 24.4.1 and ANDROID_HOME is setup to the proper location

The results of pull request testing will be appended to the request. If any tests do not pass, or relevant tests are not included, the
pull request will not be considered.
Code should compile and tests should pass under all Java versions that Nitrite supports. Currently, Nitrite supports a minimum version of Java 8.
Please run 'mvn test' to confirm. By default, running the tests requires

Talk To Us
----------

If you want to work on something or have questions / complaints please talk to us at [gitter](https://gitter.im/dizitart/nitrite-database).
If you want to work on something or have questions / complaints start a github [discussion](https://github.com/nitrite/nitrite-java/discussions).
Loading

0 comments on commit f84e5f7

Please sign in to comment.