Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
_JAVA_OPTIONS: "-Xmx3g"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2"
docker: # run the steps with Docker
- image: circleci/openjdk:8u222-jdk-stretch-node-browsers-legacy
- image: circleci/openjdk:11-jdk

steps:
- checkout
Expand Down
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

27 changes: 3 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
*.*~
*.swp
# Ignore Gradle project-specific cache directory
.gradle
*.log
.DS_Store

**/build/*

**/.DS_Store

**/bin/**/*.class

#Eclipse Files
**/.classpath
**/.project
**/.settings/*
**/.springBeans

#Ignore .gitignore from subdirectories
*/.gitignore
/bin/
/.idea/
*.iml
*.ipr
*.iws
/out/
# Ignore Gradle build output directory
build
256 changes: 94 additions & 162 deletions build.gradle
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,185 +1,117 @@
/*
* Copyright (c) 2016 Farooq Khan
* This file was generated by the Gradle 'init' task.
*
* 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.
* This generated file contains a sample Java library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/8.1.1/userguide/building_java_projects.html
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
//id 'net.saliman.cobertura' version '2.3.1'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'idea'
}

apply plugin: "java"
apply plugin: "jacoco"
apply plugin: "eclipse"
apply plugin: "signing"
apply plugin: "maven"

description = 'A pure java JSON based database.'
group = 'io.jsondb'
version = getVersionName()

ext {
println "Build Version: $version"
}

repositories {
mavenCentral()
}

dependencies {
compile "org.slf4j:slf4j-api:1.7.21",
"com.fasterxml.jackson.core:jackson-annotations:2.9.9",
"com.fasterxml.jackson.core:jackson-core:2.9.9",
"com.fasterxml.jackson.core:jackson-databind:2.9.9",
"com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.9",
"com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.9",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9",
"org.reflections:reflections:0.9.10",
"org.javassist:javassist:3.20.0-GA",
"commons-jxpath:commons-jxpath:1.3",
"com.google.guava:guava:19.0",
"commons-beanutils:commons-beanutils:1.9.3"

testCompile "junit:junit:4.12",
"org.hamcrest:hamcrest-library:1.3",
"org.springframework:spring-beans:4.3.3.RELEASE",
"org.springframework:spring-test:4.3.3.RELEASE"
}

//cobertura.coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report

jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}

eclipse {
project {
name = "${project.name}"
}
}

eclipseJdt {
inputFile = file("${rootDir}/buildsupport/eclipsesupport/settings/org.eclipse.jdt.core.prefs")
doLast {
copy {
from "${rootDir}/buildsupport/eclipsesupport/settings/org.eclipse.jdt.ui.prefs"
into "${projectDir}/.settings"
fileMode 0644
}
}
}

cleanEclipseJdt {
doFirst {
delete "${projectDir}/.settings"
}
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id 'maven-publish'
}
tasks.eclipse.dependsOn(cleanEclipse)
group = 'io.jsondb'
version = '2.0.0'

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
apply plugin: 'maven-publish'

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
mavenLocal()
}

signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
// api 'org.apache.commons:commons-math3:3.6.1'

// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation "org.slf4j:slf4j-api:2.0.7",
"com.fasterxml.jackson.core:jackson-annotations:2.15.1",
"com.fasterxml.jackson.core:jackson-core:2.15.1",
"com.fasterxml.jackson.core:jackson-databind:2.15.1",
"com.fasterxml.jackson.module:jackson-module-parameter-names:2.15.1",
"com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.15.1",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.1",
"org.reflections:reflections:0.10.2",
"org.javassist:javassist:3.29.2-GA",
"commons-jxpath:commons-jxpath:1.3",
"com.google.guava:guava:32.0.0-jre",
"commons-beanutils:commons-beanutils:1.9.4"

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3',
"org.hamcrest:hamcrest-library:2.2",
"org.springframework:spring-beans:5.3.27",
"org.springframework:spring-test:5.3.27"

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
}

uploadArchives {
//How to publish to MavenCentral: http://weibeld.net/java/publish-to-maven-central.html
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: OSSRH_USERNAME, password: OSSRH_PASSWORD)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: OSSRH_USERNAME, password: OSSRH_PASSWORD)
}

pom.project {
name 'jsondb-core'
packaging 'jar'
// optionally artifactId can be defined here
description 'A pure java JSON based database.'
url 'http://www.jsondb.io'

scm {
connection 'scm:git:https://github.com/Jsondb/jsondb-core.git'
developerConnection 'scm:git:https://github.com/Jsondb/jsondb-core.git'
url 'scm:git:https://github.com/Jsondb/jsondb-core.git'
}

licenses {
license {
name 'MIT License'
url 'https://opensource.org/licenses/MIT'
}
testing {
suites {
// Configure the built-in test suite
test {
// Use JUnit Jupiter test framework
useJUnitJupiter('5.9.1')
}
}
}

developers {
developer {
id 'FarooqKhan'
name 'Farooq Khan'
email 'FarooqKhan@users.noreply.github.com'
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'io.jsondb'
artifactId 'jsondb-core'
version version
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'io.jsondb'
description = 'A pure java JSON based database.'
url = 'https://github.com/Jsondb/jsondb-core.git'
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'FarooqKhan'
name = 'Farooq Khan'
email = 'FarooqKhan@users.noreply.github.com'
}
}
scm {
connection = 'scm:git:https://github.com/Jsondb/jsondb-core.git'
developerConnection = 'scm:git:https://github.com/Jsondb/jsondb-core.git'
url = 'scm:git:https://github.com/Jsondb/jsondb-core.git'
}
}
}
}
}
}
repositories {
mavenLocal()
}
}

/*
* Gets the version name from the latest Git tag
*/
def getVersionName() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags'
standardOutput = stdout
}
def versionString = stdout.toString().replaceFirst("-", ".");
versionString = versionString.substring(0, versionString.indexOf("-"));

if (JavaVersion.current().isJava8()) {
versionString = versionString + '-j8'
} else if (JavaVersion.current().isJava11()){
versionString = versionString + '-j11'
} else {
assert 'Only build with Java LTS version'
}

return versionString
// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
Loading