Skip to content

Commit

Permalink
Merge branch 'release/1.1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasuyuki Takeo committed Jun 18, 2020
2 parents c5bd599 + 3a70c2d commit 69bc8c2
Show file tree
Hide file tree
Showing 259 changed files with 20,849 additions and 449 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ The list of what Damascus automatically generate is as follows
* Template generation

### Required environment
* Liferay 7.0 CE GA7 and Liferay DXP SP11 or higher versions.
* Liferay 7.1 CE GA1 and higher.
* Liferay 7.3 CE GA2 and higher.
* Liferay 7.2 CE GA1 and higher.
* Liferay 7.1 CE GA1 and higher.
* Liferay 7.0 CE GA7 and Liferay DXP SP11 or higher versions.
* Java 1.8 or above
* gradle 3.0 or above need to be installed
* gradle 5.4.6 or above need to be installed
* jpm needs to be installed. (instruction to install is as follows)

### How to Install
Expand Down Expand Up @@ -58,7 +59,7 @@ Let's make a Todo app with damascus

### 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 ```gradle assemble``` then ```damascus.jar``` will be created under ```/build/libs/``` directory.
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```.

### Proxy settings
Expand All @@ -69,7 +70,7 @@ Damascus is including lombok library, so annotation library for lombok needs to
##### Eclipse (Not Liferay Developer Studio)
1. Download lombok https://projectlombok.org/download
2. double click ```lombok.jar``` and select the directory where ```eclipse.exe``` exist
3. Run ```gradle eclipse``` at the project directory and restart IDE, and right click on the project and display context name, and choose ```gradle > Refresh gradle project```
3. Run ```./gradlew eclipse``` at the project directory and restart IDE, and right click on the project and display context name, and choose ```gradle > Refresh gradle project```
4. Java files will be displayed properly without errors.
##### IntelliJ
1. ```Preferences - Plugins``` and search Lombok. Install the Lombok plugin.
Expand All @@ -79,14 +80,14 @@ Damascus is including lombok library, so annotation library for lombok needs to
In terms of bugs, please post Github issues or send me a PR. To send me PR, please follow the process below.
1. Fix bugs at your local
2. Remove ```${user}/.damascus``` folder.
3. Run test locally with this command ```gradle clean test``` and confirm your fix pass all tests.
3. Run test locally with this command ```./gradlew clean test --info``` and confirm your fix pass all tests.
4. Send PR to /development repository. I'll create a fix brunch accordingly.

### Enhancement requests
A contribution is always welcome! In terms of an Enhancement request, please follow the process below. If you wonder it's a complex feature, please create an issue first and let's discuss. In terms of simple enhancement, please follow steps below.

1. After implementing your feature, please add a test as well. Spock test is preferable because it's more readable and flexible to add tests later on. To add tests, tests are separated by classes, and in a test class, each test should be written each method basis.
2. Run test locally with ```gradle clean test``` until your code pass all tests
2. Run test locally with ```./gradlew clean test --info``` until your code pass all tests
3. Send a PR to /development branch. According to the status of Travis CI / Appveyor, I may create a feature branch and request you to make it pass the test on Travis CI / Appveyor environment.
4. After all tests pass on Travis CI / Appveyor, will merge into the development branch and release into master at some points according to the impact of the code.

Expand Down
71 changes: 32 additions & 39 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

plugins {
id 'io.franzbecker.gradle-lombok' version '3.2.0'
id "io.freefair.lombok" version "5.1.0"
id 'java'
id 'groovy'
id 'eclipse'
Expand All @@ -20,11 +20,6 @@ plugins {

apply plugin: 'com.github.kt3k.coveralls'

lombok { // optional: values below are the defaults
version = "1.18.10"
sha256 = ""
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

Expand All @@ -34,17 +29,16 @@ def defaultEncoding = 'UTF-8'
repositories {
mavenCentral()
jcenter()
maven {
url 'https://repo.gradle.org/gradle/libs-releases'
url "http://repository.jboss.org/nexus/content/groups/public-jboss" // JBoss
url "http://repository.apache.org/content/groups/public" // Apache
url "http://repository.springsource.com/maven/bundles/release" // SpringSource
url "http://repository.codehaus.org" // Codehaus
url "http://download.java.net/maven/2" // Java.NET
url "http://download.java.net/maven/glassfish" // Glassfish
url "http://m2repo.spockframework.org/snapshots" // Spock Snapshot
url "http://repository.sonatype.org/content/groups/public"
}
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 {
Expand All @@ -53,12 +47,11 @@ generateGrammarSource {
outputDirectory = file('src/main/java/com/liferay/damascus/antlr/template')
}


jar {
manifest {
attributes(
"Bundle-SymbolicName": "com.liferay.damascus.cli",
"Bundle-Version": "1.1.5",
"Bundle-Version": "1.1.6",
"Bundle-Description": "Liferay extension tool for scaffolding service builder portlet",
"Main-Class": "com.liferay.damascus.cli.Damascus",
"JPM-Command": "damascus"
Expand All @@ -71,33 +64,33 @@ jar {

dependencies {
compile 'com.beust:jcommander:1.72'
compile 'com.google.guava:guava:28.1-jre'
compile 'commons-io:commons-io:2.6'
compile 'org.apache.commons:commons-lang3:3.7'
compile 'org.apache.commons:commons-configuration2:2.6'
compile 'commons-beanutils:commons-beanutils:1.9.+'
compile 'com.google.guava:guava:29.0-jre'
compile 'commons-io:commons-io:2.7'
compile 'org.apache.commons:commons-lang3:3.10'
compile 'org.apache.commons:commons-configuration2:2.7'
compile 'commons-beanutils:commons-beanutils:1.9.4'
compile 'com.jayway.jsonpath:json-path:2.4.+'

compile 'org.freemarker:freemarker:2.3.28'
compile 'com.liferay:com.liferay.project.templates:5.0.2'
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'org.slf4j:slf4j-log4j12:1.7.25'
compile 'com.fasterxml.jackson.core:jackson-core:2.9.+'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.+'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.+'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.9.+'
compile 'joda-time:joda-time:2.9.+'
compile 'org.gradle:gradle-tooling-api:4.3'
compile 'org.freemarker:freemarker:2.3.30'
compile 'com.liferay:com.liferay.project.templates:5.0.32'
compile 'org.gradle:gradle-tooling-api:4.10.3'
compile 'org.slf4j:slf4j-api:1.7.+'
compile 'org.slf4j:slf4j-log4j12:1.7.+'
compile 'com.fasterxml.jackson.core:jackson-core:2.11.+'
compile 'com.fasterxml.jackson.core:jackson-databind:2.11.+'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.11.+'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.11.+'
compile 'joda-time:joda-time:2.10.+'
compile 'org.codehaus.groovy:groovy-all:2.5.8'

compile group: 'org.antlr', name: 'antlr4', version: '4.7.2'
compile group: 'org.antlr', name: 'antlr4-runtime', version: '4.7.2'
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'

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

testCompile group: 'org.antlr', name: 'antlr4-runtime-testsuite', version: '4.7.1'
testCompile group: 'cglib', name: 'cglib-nodep', version:'3.2.5'
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'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Binary file modified latest/damascus.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from DmscSrcLexer.g4 by ANTLR 4.7.2
// Generated from DmscSrcLexer.g4 by ANTLR 4.8
package com.liferay.damascus.antlr.template;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
Expand All @@ -11,7 +11,7 @@

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class DmscSrcLexer extends Lexer {
static { RuntimeMetaData.checkVersion("4.7.2", RuntimeMetaData.VERSION); }
static { RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); }

protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from DmscSrcParser.g4 by ANTLR 4.7.2
// Generated from DmscSrcParser.g4 by ANTLR 4.8
package com.liferay.damascus.antlr.template;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
Expand All @@ -11,7 +11,7 @@

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class DmscSrcParser extends Parser {
static { RuntimeMetaData.checkVersion("4.7.2", RuntimeMetaData.VERSION); }
static { RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); }

protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from DmscSrcParser.g4 by ANTLR 4.7.2
// Generated from DmscSrcParser.g4 by ANTLR 4.8
package com.liferay.damascus.antlr.template;

import org.antlr.v4.runtime.ParserRuleContext;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from DmscSrcParser.g4 by ANTLR 4.7.2
// Generated from DmscSrcParser.g4 by ANTLR 4.8
package com.liferay.damascus.antlr.template;
import org.antlr.v4.runtime.tree.ParseTreeListener;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/liferay/damascus/cli/Damascus.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@Slf4j
public class Damascus {

public final static String VERSION = "1.1.5";// + "_" + LocalDateTime.now().toString();
public final static String VERSION = "1.1.6";// + "_" + LocalDateTime.now().toString();

/**
* Main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
* Template Generator command
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class DamascusProps {
public static final String VERSION_70 = "7.0";
public static final String VERSION_71 = "7.1";
public static final String VERSION_72 = "7.2";
public static final String VERSION_73 = "7.3";

/**
* Service Builder command
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/com/liferay/damascus/cli/json/Application.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
package com.liferay.damascus.cli.json;

import java.security.InvalidParameterException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.liferay.damascus.cli.json.fields.FieldBase;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.security.InvalidParameterException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
* JSON structure POJO : Application
* <p>
Expand Down Expand Up @@ -42,9 +41,6 @@ public class Application {
@JsonProperty(required = true)
public Asset asset = null;

@JsonProperty(required = true)
public String fieldsName = null;

@JsonProperty(required = true)
public List<FieldBase> fields = null;

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/liferay/damascus/cli/json/DamascusBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public class DamascusBase {

public Map<String, String> customValue;

@JsonProperty
public boolean useTargetPlatform = false;

@JsonProperty(required = true)
public List<Application> applications = null;

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/templates/7.0/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"generateActivity": "true",
"trash":"true"
},
"fieldsName" : "${damascus.projectName}s",
"fields": [
{
"type": "com.liferay.damascus.cli.json.fields.Long",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ apply plugin: 'eclipse'

dependencies {
compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
compileOnly group: "com.liferay", name: "com.liferay.osgi.util", version: "3.0.0"
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "3.0.0"
compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
compileOnly group: "com.liferay", name: "com.liferay.osgi.util"<#if useTP?? && false == useTP>, version: "3.0.0"</#if>
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"<#if useTP?? && false == useTP>, version: "3.0.0"</#if>
compileOnly group: "javax.portlet", name: "portlet-api"<#if useTP?? && false == useTP>, version: "2.0"</#if>
compileOnly group: "javax.servlet", name: "javax.servlet-api"<#if useTP?? && false == useTP>, version: "3.0.1"</#if>
compileOnly group: "org.osgi", name: "org.osgi.core"<#if useTP?? && false == useTP>, version: "6.0.0"</#if>
}
24 changes: 13 additions & 11 deletions src/main/resources/templates/7.1/Portlet_XXXXSVC_build.gradle.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@ repositories {

dependencies {
compile 'com.google.errorprone:error_prone_annotations:2.0.19'
compile 'commons-digester:commons-digester:1.8.1'
compile "com.google.guava:guava:21.0"
compile "commons-io:commons-io:2.5"
compile "commons-validator:commons-validator:1.6"
compile 'commons-digester:commons-digester<#if useTP?? && false == useTP>:1.8.1</#if>'
compile "com.google.guava:guava<#if useTP?? && false == useTP>:21.0</#if>"
compile "commons-io:commons-io<#if useTP?? && false == useTP>:2.5</#if>"
compile "commons-validator:commons-validator<#if useTP?? && false == useTP>:1.6</#if>"
compile "org.apache.commons:commons-lang3:3.5"

compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
compile group: "com.liferay", name: "com.liferay.portal.spring.extender.api", version: "3.0.0"
compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "3.0.0"
compile group: "com.liferay", name: "com.liferay.osgi.util", version: "3.0.0"
compile group: "javax.portlet", name: "portlet-api", version: "3.0.0"
compile group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
compile group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
compileOnly group: "com.liferay", name: "com.liferay.portal.spring.extender.api"<#if useTP?? && false == useTP>, version: "3.0.0"</#if>
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"<#if useTP?? && false == useTP>, version: "3.0.0"</#if>
compileOnly group: "com.liferay", name: "com.liferay.osgi.util"<#if useTP?? && false == useTP>, version: "3.0.0"</#if>
compileOnly group: "com.liferay", name: "com.liferay.petra.lang"<#if useTP?? && false == useTP>, version: "1.0.0"</#if>
compileOnly group: "com.liferay", name: "com.liferay.petra.string"<#if useTP?? && false == useTP>, version: "1.0.0"</#if>
compileOnly group: "javax.portlet", name: "portlet-api"<#if useTP?? && false == useTP>, version: "3.0.0"</#if>
compileOnly group: "javax.servlet", name: "javax.servlet-api"<#if useTP?? && false == useTP>, version: "3.0.1"</#if>
compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"<#if useTP?? && false == useTP>, version: "1.3.0"</#if>
compile project(":${dashcaseProjectName}-api")
}

Expand Down
Loading

0 comments on commit 69bc8c2

Please sign in to comment.