Skip to content

Commit

Permalink
Merge pull request #12 from chirag-ji/develop
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
chirag-ji authored Jul 20, 2022
2 parents c89a09f + 6faa046 commit 4039634
Show file tree
Hide file tree
Showing 62 changed files with 1,688 additions and 369 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

50 changes: 50 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Java Build

on:
push: { }
pull_request:
types: [ opened, synchronize, reopened ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build

- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Build And Analyse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonarqube --info
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
.idea/
20 changes: 0 additions & 20 deletions .idea/artifacts/DocuConverter_jar.xml

This file was deleted.

26 changes: 0 additions & 26 deletions .idea/libraries/lib.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

124 changes: 0 additions & 124 deletions .idea/uiDesigner.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

12 changes: 0 additions & 12 deletions DocuConverter.iml

This file was deleted.

100 changes: 100 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import java.text.SimpleDateFormat

plugins {
id 'java-library'
id "com.github.gmazzo.buildconfig" version "3.0.3"
id "org.sonarqube" version "3.4.0.2513"
}

repositories {
mavenCentral()
}

int versionCode = 1
group 'com.chiragji'
version '2.0.0'

static def getDateTime() {
return new Date().format("yyyyMMdd.HHmm")
}

Date buildDate = new Date()
String buildDateTag = getDateTime()
String buildTag = project.version + '_' + buildDateTag + '_' + versionCode
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")

buildConfig {
def rootProjectName = project.rootProject.name.toLowerCase()

packageName("${project.group}.${rootProjectName}")

buildConfigField 'String', 'APP_NAME', "\"${project.rootProject.name}\""
buildConfigField 'String', 'VERSION', "\"$version\""
buildConfigField 'String', 'BUILD_TAG', "\"$buildDateTag\""
buildConfigField 'String', 'BUILD', "\"$version.$buildDateTag\""
buildConfigField 'String', 'LICENCE', "\"MIT License\""
buildConfigField 'String', 'COPYRIGHT_YEAR', "\"2019\""
buildConfigField 'java.util.Date', 'BUILD_DATE', "new java.util.Date(${buildDate.getTime()}L)"
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}

jar {
manifest {
attributes(
"Version-Code": versionCode,
"Build-Time": formatter.format(buildDate),
"Release-Version": project.version,
"Release-Tag": buildTag
)
}
}

sonarqube {
properties {
property "sonar.projectKey", "DocuConverter"
property "sonar.organization", "chirag-ji"
property "sonar.host.url", "https://sonarcloud.io"
}
}

ext {
apachePoi = "5.2.2"
}

dependencies {
implementation 'com.google.guava:guava:31.1-jre'
implementation 'args4j:args4j:2.33'
implementation 'org.docx4j:docx4j:6.1.2'
implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'org.apache.commons:commons-compress:1.21'
implementation 'commons-io:commons-io:2.11.0'

implementation 'com.itextpdf:itextpdf:5.5.13.3'
implementation 'com.itextpdf:itext-asian:5.2.0'

implementation "org.apache.poi:poi:$apachePoi"
implementation "org.apache.poi:poi-ooxml-lite:$apachePoi"
implementation "org.apache.poi:poi-scratchpad:$apachePoi"
implementation "org.apache.poi:poi-ooxml:$apachePoi"
implementation 'org.apache.xmlbeans:xmlbeans:5.1.0'

implementation 'fr.opensagres.xdocreport:fr.opensagres.xdocreport.document:2.0.3'
implementation 'fr.opensagres.xdocreport:fr.opensagres.xdocreport.document.docx:2.0.3'
implementation 'fr.opensagres.xdocreport:fr.opensagres.xdocreport.converter.docx.xwpf:2.0.3'
implementation 'fr.opensagres.xdocreport:org.apache.poi.xwpf.converter.pdf:1.0.6'
implementation 'fr.opensagres.xdocreport:fr.opensagres.xdocreport.template:2.0.3'

testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
testImplementation 'org.mockito:mockito-core:4.6.1'
testImplementation 'org.mockito:mockito-junit-jupiter:4.6.1'
testImplementation 'commons-io:commons-io:2.11.0'
}

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

0 comments on commit 4039634

Please sign in to comment.