Skip to content

Commit

Permalink
Merge pull request #26 from saasquatch/gradle-dev
Browse files Browse the repository at this point in the history
0.2.0
  • Loading branch information
slisaasquatch authored Apr 24, 2023
2 parents 3796e88 + 5f7a600 commit 6e6d55e
Show file tree
Hide file tree
Showing 262 changed files with 133,996 additions and 1,110 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/JavaCI.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: JavaCI
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: "8"
distribution: adopt
- name: Maven Package
run: mvn -B -U clean package -DskipTests
- name: Maven Verify
run: mvn -B -U verify
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew build
12 changes: 3 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

Expand All @@ -38,3 +29,6 @@ buildNumber.properties
.mvn/wrapper/maven-wrapper.jar
.idea
*.iml
.gradle
.gradletasknamecache
.m2
18 changes: 0 additions & 18 deletions .mvn/wrapper/maven-wrapper.properties

This file was deleted.

57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Changelog

## [Unreleased]

## [0.2.0] - 2023-04-24

### Changed

- Switched to Gradle.
- Added support for JSON Schema draft 2019-09 and 2020-12.
- Internal dependency version bumps.
- Test suite cleanup.

### Fixed

- Fixed the `time` format inference in `FormatInferrers.dateTime()` to better adhere to the JSON Schema standard. It is trivial to restore the original behavior with a custom implementation of `FormatInferrer`.

## [0.1.5] - 2022-03-10

### Changed

- Switched to Maven Wrapper.
- Internal dependency version bumps.

## [0.1.4] - 2021-07-21

## [0.1.3] - 2021-05-21

### Changed

- Internal dependency version bumps.

### Fixed

- Fixed errors when building for JDK 11 and 12. See [#6](https://github.com/saasquatch/json-schema-inferrer/pull/6).

## [0.1.2] - 2020-03-12

### Changed

- Internal dependency version bumps.

## [0.1.1] - 2020-02-27

[Unreleased]: https://github.com/saasquatch/json-schema-inferrer/compare/0.2.0...HEAD

[0.0.6]: https://github.com/saasquatch/json-schema-inferrer/compare/0.1.5...0.2.0

[0.0.5]: https://github.com/saasquatch/json-schema-inferrer/compare/0.1.4...0.1.5

[0.0.4]: https://github.com/saasquatch/json-schema-inferrer/compare/0.1.3...0.1.4

[0.0.3]: https://github.com/saasquatch/json-schema-inferrer/compare/0.1.2...0.1.3

[0.0.2]: https://github.com/saasquatch/json-schema-inferrer/compare/0.1.1...0.1.2

[0.0.1]: https://github.com/saasquatch/json-schema-inferrer/releases/tag/0.1.1
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![JavaCI](https://github.com/saasquatch/json-schema-inferrer/actions/workflows/JavaCI.yml/badge.svg?branch=master)](https://github.com/saasquatch/json-schema-inferrer/actions/workflows/JavaCI.yml)
[![codecov](https://codecov.io/gh/saasquatch/json-schema-inferrer/branch/master/graph/badge.svg)](https://codecov.io/gh/saasquatch/json-schema-inferrer)
[![](https://jitpack.io/v/saasquatch/json-schema-inferrer.svg)](https://jitpack.io/#saasquatch/json-schema-inferrer)

Java library for inferring JSON schema based on sample JSONs.
Expand Down Expand Up @@ -176,19 +175,19 @@ Maven
<dependency>
<groupId>com.github.saasquatch</groupId>
<artifactId>json-schema-inferrer</artifactId>
<version>0.1.5</version>
<version>0.2.0</version>
</dependency>
```

Gradle

```gradle
implementation 'com.github.saasquatch:json-schema-inferrer:0.1.5'
implementation 'com.github.saasquatch:json-schema-inferrer:0.2.0'
```

### Transitive Dependencies

This project requires Java 8. The only required transitive dependencies are [Jackson](https://github.com/FasterXML/jackson) and [FindBugs (JSR305)](http://findbugs.sourceforge.net/). If you opt into using some of the built-in [`FormatInferrers`](https://github.com/saasquatch/json-schema-inferrer/blob/master/src/main/java/com/saasquatch/jsonschemainferrer/FormatInferrers.java), [Commons Validator](https://commons.apache.org/proper/commons-validator/) will also be needed.
This project requires Java 8. The only required transitive dependencies are [Jackson](https://github.com/FasterXML/jackson) and [FindBugs (JSR305)](http://findbugs.sourceforge.net/). If you opt into using some of the built-in [`FormatInferrers`](https://github.com/saasquatch/json-schema-inferrer/blob/master/src/main/java/com/saasquatch/jsonschemainferrer/FormatInferrers.java), [Commons Validator](https://commons.apache.org/proper/commons-validator/) will also be needed. This is encapsulated with a [Gradle feature variant](https://docs.gradle.org/current/userguide/feature_variants.html) named `builtInFormatInferrerSupport`.

### Pre-release Versions

Expand Down
34 changes: 34 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
plugins {
id 'java-library'
}

group = 'com.saasquatch'
version = '1.0-SNAPSHOT'

java {
registerFeature('builtInFormatInferrerSupport') {
usingSourceSet(sourceSets.main)
}
}

tasks.compileJava.options.encoding = 'UTF-8'
tasks.compileTestJava.options.encoding = 'UTF-8'
tasks.javadoc.options.encoding = 'UTF-8'

repositories {
mavenCentral()
}

dependencies {
testImplementation platform('org.junit:junit-bom:5.9.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
api 'com.fasterxml.jackson.core:jackson-databind:2.15.0'
builtInFormatInferrerSupportImplementation 'commons-validator:commons-validator:1.7'
testImplementation 'com.networknt:json-schema-validator:1.0.80'
testImplementation 'com.google.guava:guava:31.1-jre'
}

tasks.test {
useJUnitPlatform()
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 6e6d55e

Please sign in to comment.