Skip to content

Commit

Permalink
initial commit with code
Browse files Browse the repository at this point in the history
  • Loading branch information
elisherer committed Apr 8, 2024
1 parent f1f0327 commit dd337a9
Show file tree
Hide file tree
Showing 24 changed files with 1,019 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

# cancel previous tests if new commit is pushed to PR branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:

runs-on: ubuntu-latest

permissions:
contents: read
checks: write

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
java-package: jdk
cache: gradle

- name: Setup Gradle
uses: gradle/[email protected]

- name: Run tests with Gradle
uses: gradle/[email protected]
with:
# build includes tests
arguments: |
build
--console=plain
--parallel
-Dorg.gradle.parallel.intra=true
- name: Tests Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Test Results # Name of the check run which will be created
path: '**/build/test-results/test/*.xml' # Path to test results
reporter: java-junit # Format of test results
list-suites: 'failed' # Limits which test suites are listed: (*all/failed) *default
list-tests: 'failed' # Limits which test cases are listed: (*all/failed/none) *default

83 changes: 83 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Created by https://www.gitignore.io/api/java,gradle,intellij+all
# Edit at https://www.gitignore.io/?templates=java,gradle,intellij+all

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# File-based project format
*.iws

# IntelliJ
out/
**/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/
htmlReport/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

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

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

### Gradle ###
.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

### Gradle Patch ###
**/build/

# Mac DS Store
**/.DS_Store

# End of https://www.gitignore.io/api/java,gradle,intellij+all

# ignore binaries created by VScode Java plugins
**/bin/
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# json-transform-core

[![Maven Central Version](https://img.shields.io/maven-central/v/co.nlighten/json-transform-core)](https://central.sonatype.com/artifact/co.nlighten/json-transform-core)
[![javadoc](https://javadoc.io/badge2/co.nlighten/json-transform-core/javadoc.svg)](https://javadoc.io/doc/co.nlighten/json-transform-core)
[![Build](https://github.com/nlighten-oss/json-transform-core/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/nlighten-oss/json-transform-core/actions/workflows/ci.yml)
[![GitHub Release](https://img.shields.io/github/v/release/nlighten-oss/json-transform-core)](https://github.com/nlighten-oss/json-transform-core/releases)
[![License](https://img.shields.io/github/license/nlighten-oss/json-transform-core)](./LICENSE)


## Installation

Maven
```xml
<dependency>
<groupId>co.nlighten</groupId>
<artifactId>json-transform-core</artifactId>
<version>0.1.1</version>
</dependency>
```

Gradle
```groovy
implementation 'co.nlighten:json-transform-core:0.1.1'
```

## License

[Apache License 2.0](./LICENSE)
98 changes: 98 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id 'java-library'
id "com.vanniktech.maven.publish" version "0.28.0"
}

group 'co.nlighten'
version = '0.1.1'

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}

jar { archiveClassifier = '' }

ext.genOutputDir = file("$buildDir/generated-resources")

task generateVersionTxt() {
ext.outputFile = file("$genOutputDir/version.txt")
outputs.file(outputFile)
doLast {
outputFile.text = """GroupId: ${project.group}
Name: ${project.name}
Version: $version
Build-time: ${java.time.LocalDateTime.now()}
"""
}
}

sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt

test {
useJUnitPlatform()
}

// NOTE: this is done automatically by mavenPublishing.configure
//java {
// withJavadocJar()
// withSourcesJar()
//}

javadoc {
options.showAll()
options.encoding('UTF-8')
options.addStringOption('Xdoclint:none', '-quiet')
(options as StandardJavadocDocletOptions).tags("apiNote:a:API Note:")
}

mavenPublishing {
configure(new JavaLibrary(new JavadocJar.Javadoc(), true))
//publishToMavenCentral(SonatypeHost.DEFAULT, true)
// or when publishing to https://s01.oss.sonatype.org
// publishToMavenCentral(SonatypeHost.S01)
// or when publishing to https://central.sonatype.com/
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

signAllPublications()

coordinates("${project.group}", 'json-transform-core', "${version}")

pom {
name = 'json-transform-core'
description = 'Core library for JSON transformation'
inceptionYear = "2024"
url = 'https://github.com/nlighten-oss/json-transform-core'
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "elisherer"
name = "Eli Sherer"
url = "https://github.com/elisherer/"
}
}
scm {
url = 'https://github.com/nlighten-oss/json-transform-core'
connection = 'scm:git://github.com/nlighten-oss/json-transform-core.git'
developerConnection = 'scm:git://github.com/nlighten-oss/json-transform-core.git'
}
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit dd337a9

Please sign in to comment.