Skip to content

Commit

Permalink
Merge branch 'release/1.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasuyuki Takeo committed Oct 11, 2021
2 parents eb17228 + 486e6a9 commit 0672308
Show file tree
Hide file tree
Showing 39 changed files with 498 additions and 414 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest]
java: [1.8]
java: [8]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
- uses: eskatos/gradle-command-action@v1
distribution: 'adopt'
cache: gradle
- name: run test
uses: gradle/gradle-build-action@v2
with:
arguments: check
gradle-version: 7.2
arguments: test
- name: Generate Coveralls Test Report
run: ./gradlew jacocoTestReport coveralls
env:
COVERALLS_REPO_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN}}
CI_NAME: Github Actions
CI_BRANCH: ${{github.ref}}
CI_PULL_REQUEST: ${{github.event.pull_request.html_url}}


8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ curl https://raw.githubusercontent.com/yasuflatland-lf/damascus/master/installer

**Windows**
1. [Download jpm](https://raw.githubusercontent.com/jpm4j/jpm4j.installers/master/dist/jpm-setup.exe) and install.
2. Install damascus.jar with jpm as follows. ```jpm install https://github.com/yasuflatland-lf/damascus/raw/master/latest/damascus.jar```
2. Install damascus-all.jar with jpm as follows. ```jpm install https://github.com/yasuflatland-lf/damascus/raw/master/latest/damascus-all.jar```

### How to update
1. Run jpm remove damascus to uninstall damascus.
Expand All @@ -50,15 +50,15 @@ curl https://raw.githubusercontent.com/yasuflatland-lf/damascus/master/installer
### Getting started
Let's make a Todo app with damascus
1. Create a Liferay workspace with Blade cli or Liferay IDE / Liferay Developer Studio. For more details, please see [this document](https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/blade-cli).
2. After creating Liferay workspace, navigate to under ```modules``` folder and run ```damascus init -c Todo -p com.liferay.sb.test -v 7.2```
2. After creating Liferay workspace, navigate to under ```modules``` folder and run ```damascus init -c Todo -p com.liferay.sb.test -v 7.3```
3. Navigate to ```todo``` folder. You'll see ```base.json``` file is created. For detailed configuration, please see [the official documentation](https://yasuflatland-lf.github.io/damascus-doc/). Just for demonstration now, we'll create a scaffolding as it is.
4. Type ```damascus create``` and damascus will create a scaffolding service and portlet according to the base.json file.
5. Start up your Liferay server and in the ```Todo``` folder, type ```blade deploy```. Blade will run properly and service and portlet will be deployed.

### How to compile Damascus on your own?
1. Clone this repository to your local. Please make sure you've already installed Gradle 3.0 or above and jpm.
2. At the root directory, run ```./gradlew assemble``` then ```damascus.jar``` will be created under ```/build/libs/``` directory.
3. If you've already installed damascus, uninstall it first with ```jpm remove damascus```. Then install your jar with ```jpm install ./damascus.jar```.
2. At the root directory, run ```./gradlew shadowJar``` then ```damascus-all.jar``` will be created under ```/build/libs/``` directory.
3. If you've already installed damascus, uninstall it first with ```jpm remove damascus```. Then install your jar with ```jpm install ./damascus-all.jar```.

### Proxy settings
Please see more detailed settings [here](https://github.com/yasuflatland-lf/damascus/wiki/4.-Proxy-settings)
Expand Down
162 changes: 91 additions & 71 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:latest.release'
}
}

plugins {
id "io.freefair.lombok" version "5.3.0"
id 'com.github.johnrengelman.shadow' version '7.1.0'
id 'java'
id "io.freefair.lombok" version "6.1.0-m3"
id 'groovy'
id 'eclipse'
id 'idea'
id 'jacoco'
id 'antlr'
id "org.sonarqube" version "3.0"
id 'com.github.kt3k.coveralls' version '2.10.2'
id "org.sonarqube" version "3.3"
id 'com.github.kt3k.coveralls' version '2.12.0'
}

sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -28,20 +20,12 @@ def defaultEncoding = 'UTF-8'

repositories {
mavenCentral()
jcenter()
maven { url 'https://repo.gradle.org/gradle/libs-releases'}
maven { url 'https://repo.gradle.org/gradle/libs-releases-local' }
maven { url "http://repository.jboss.org/nexus/content/groups/public-jboss" }
maven { url "http://repository.apache.org/content/groups/public" }
maven { url "http://repository.springsource.com/maven/bundles/release" }
maven { url "http://repository.codehaus.org" }
maven { url "http://download.java.net/maven/2" }
maven { url "http://download.java.net/maven/glassfish" }
maven { url "http://m2repo.spockframework.org/snapshots" }
maven { url "http://repository.sonatype.org/content/groups/public" }
}

generateGrammarSource {
mustRunAfter "checkLombokConfig"
arguments << "-lib" << "src/main/antlr/"
arguments << "-package" << "com.liferay.damascus.antlr.template"
outputDirectory = file('src/main/java/com/liferay/damascus/antlr/template')
Expand All @@ -51,78 +35,114 @@ jar {
manifest {
attributes(
"Bundle-SymbolicName": "com.liferay.damascus.cli",
"Bundle-Version": "1.1.6",
"Bundle-Version": '1.2.3',
"Bundle-Description": "Liferay extension tool for scaffolding service builder portlet",
"Main-Class": "com.liferay.damascus.cli.Damascus",
"JPM-Command": "damascus"
)
}
from {
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
}
}

dependencies {
compile 'com.beust:jcommander:1.72'
compile 'com.google.guava:guava:30.1-jre'
compile 'commons-io:commons-io:2.8.+'
compile 'org.apache.commons:commons-lang3:3.11'
compile 'org.apache.commons:commons-configuration2:2.7'
compile 'commons-beanutils:commons-beanutils:1.9.4'
compile 'com.jayway.jsonpath:json-path:2.5.+'

compile 'org.freemarker:freemarker:2.3.30'
compile 'org.gradle:gradle-tooling-api:6.7.1'
compile 'com.liferay:com.liferay.project.templates:5.0.101'

compile 'org.slf4j:slf4j-api:1.7.+'
compile 'org.slf4j:slf4j-log4j12:1.7.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.12.+'
compile 'com.fasterxml.jackson.core:jackson-databind:2.12.+'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.12.+'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.+'
compile 'joda-time:joda-time:2.10.+'
compile 'org.codehaus.groovy:groovy-all:2.5.+'

compile group: 'org.antlr', name: 'antlr4', version: '4.8-1'
compile group: 'org.antlr', name: 'antlr4-runtime', version: '4.8-1'
compile group: 'org.antlr', name: 'antlr4-annotations', version: '4.3'
implementation 'com.beust:jcommander:1.81'
implementation 'com.google.guava:guava:30.1.1-jre'
implementation 'commons-io:commons-io:2.11.+'
implementation 'org.apache.commons:commons-lang3:3.12.+'
implementation 'org.apache.commons:commons-configuration2:2.7'
implementation 'commons-beanutils:commons-beanutils:1.9.4'
implementation 'com.jayway.jsonpath:json-path:2.6.+'

implementation 'org.freemarker:freemarker:2.3.31'
implementation 'org.gradle:gradle-tooling-api:7.1.1'
implementation 'com.liferay:com.liferay.project.templates:5.0.157'

implementation 'org.slf4j:slf4j-api:1.7.+'
implementation 'org.slf4j:slf4j-log4j12:1.7.+'
implementation 'com.fasterxml.jackson.core:jackson-core:2.12.+'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.+'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.+'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.+'
implementation 'joda-time:joda-time:2.10.+'
implementation 'org.codehaus.groovy:groovy-all:3.0.9'

implementation group: 'org.antlr', name: 'antlr4', version: '4.8-1'
implementation group: 'org.antlr', name: 'antlr4-runtime', version: '4.8-1'
implementation group: 'org.antlr', name: 'antlr4-annotations', version: '4.3'

antlr 'org.antlr:antlr4:4.8-1'

testCompile group: 'org.antlr', name: 'antlr4-runtime-testsuite', version: '4.8-1'
testCompile group: 'cglib', name: 'cglib-nodep', version:'3.3.0'
testCompile group: 'junit', name: 'junit', version:'4.12'

testCompile group: 'org.hamcrest', name: 'hamcrest-core', version:'1.3'
testCompile group: 'org.objenesis', name: 'objenesis', version:'2.6'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.28.+'
testCompile group: 'org.powermock', name: 'powermock-core', version: '2.0.9'
testCompile group: 'org.powermock', name: 'powermock-classloading-xstream', version:'2.0.9'
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version:'2.0.9'
testCompile group: 'org.powermock', name: 'powermock-module-junit4-common', version:'2.0.9'
testCompile group: 'org.powermock', name: 'powermock-module-junit4-rule', version:'2.0.9'
testCompile group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.9'

testCompile('org.spockframework:spock-core:1.3-groovy-2.5') {
exclude module: 'groovy-all'
}

// you can use testRuntimeClasspath if you don't want to use spock-report-specific features in your Specs
testImplementation( 'com.athaydes:spock-reports:1.7.1' ) {
testImplementation group: 'org.antlr', name: 'antlr4-runtime-testsuite', version: '4.8-1'
testImplementation group: 'cglib', name: 'cglib-nodep', version:'3.3.0'

testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.28.+'
testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version:'2.2'
testImplementation group: 'org.objenesis', name: 'objenesis', version:'3.2'
testImplementation group: 'org.powermock', name: 'powermock-core', version: '2.0.9'
testImplementation group: 'org.powermock', name: 'powermock-classloading-xstream', version:'2.0.9'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version:'2.0.9'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4-common', version:'2.0.9'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4-rule', version:'2.0.9'
testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.9'
testImplementation group: 'org.powermock', name: 'powermock-api-support', version: '2.0.9'

testImplementation('org.spockframework:spock-core:2.0-groovy-3.0')
testImplementation( 'com.athaydes:spock-reports:2.0-groovy-3.0' ) {
transitive = false // this avoids affecting your version of Groovy/Spock
}
testImplementation('org.junit.jupiter:junit-jupiter-api:5.7.2')
// you can use testRuntimeClasspath if you don't want to use spock-report-specific features in your Specs
}

test {
useJUnitPlatform()
testLogging.showStandardStreams = true
}

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

check.dependsOn jacocoTestReport

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

// Output each test title
tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces true

// set options for log level DEBUG and INFO
debug {
events TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat

afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 0672308

Please sign in to comment.