Skip to content

Integrate Github Actions and Dependabot, include updates it suggested #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
637 changes: 637 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: daily
time: "19:00"
open-pull-requests-limit: 10
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Java Gradle CI test

on: [push]

jobs:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
# gradleValidation: ## Skipped till samples is updated/fixed
# name: Gradle Wrapper
# runs-on: ubuntu-latest
# steps:
#
# # Check out current repository
# - name: Fetch Sources
# uses: actions/checkout@v2.3.4
#
# # Validate wrapper
# - name: Gradle Wrapper Validation
# uses: gradle/wrapper-validation-action@v1.0.3
test:
runs-on: ubuntu-latest
steps:
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- uses: actions/checkout@v2

# Cache Gradle dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2.1.5
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}

# Cache Gradle Wrapper
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v2.1.5
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}

- name: Clean
run: ./gradlew clean


- name: Test Plugin
run: ./gradlew test

- name: Build Plugin
run: ./gradlew buildPlugin


- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: Package
path: build/distributions
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### Since 1.0.0 (1 Feb 2021):

- Fixed bugs
- Refactor build.gradle upgrade dependence versions
- Upgrade JDK 11
- improve code and clean code refactors
- test: IntelliJ IDEA 2020.3.2 (Community Edition) Build #IC-203.xx

### Since 0.12.0 (11 Apr 2018):

- Fixed issues with metadata that contains multiple references
Expand Down Expand Up @@ -49,5 +57,5 @@
- Updated correct path for animation in plugin.xml

### Since 0.1.0 (30 Nov 2017):

- Initial support for Spring Assistant from both libraries & `@ConfigurationProperties` classes
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Feel free to let me know what else you want added via the [issues](https://githu

Suggestions, feedback and other comments welcome via [@1tontech](https://twitter.com/1tontech) on Twitter

[intellij-spring-assistant-1.0.1.zip](dist/intellij-spring-assistant-1.0.1.zip)

## Changelog

See [here](CHANGELOG.md)
Expand Down
125 changes: 72 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,61 +1,95 @@
import com.vladsch.flexmark.ast.Document
import com.vladsch.flexmark.html.HtmlRenderer
import com.vladsch.flexmark.parser.Parser

version '0.12.0'
import com.vladsch.flexmark.util.ast.Document

buildscript {
apply plugin: 'groovy'

repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url 'http://dl.bintray.com/jetbrains/intellij-plugin-service'
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.org.jetbrains.intellij.plugins:gradle-intellij-plugin:0.2.18"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
classpath 'org.codehaus.groovy:groovy-all:2.4.13'
classpath group: 'com.vladsch.flexmark', name: 'flexmark', version: '0.28.12'
classpath 'com.vladsch.flexmark:flexmark:0.62.2' // '0.28.12'
}
}

apply plugin: 'java'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'org.junit.platform.gradle.plugin'
plugins {
id 'java'
id 'idea'
id 'org.jetbrains.intellij' version '0.7.3'
}


sourceCompatibility = 1.8
group = 'in.oneton.idea.spring'
version = '1.0.1'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"

repositories {
mavenLocal()
mavenCentral()
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
testCompileOnly {
extendsFrom annotationProcessor
}
}

dependencies {
compileOnly 'org.projectlombok:lombok:1.16.20'
compile 'org.apache.commons:commons-collections4:4.1'
compile 'com.miguelfonseca.completely:completely-core:0.8.0'

testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.1'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.0.1'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.12.0'
['annotationProcessor', 'compileOnly', 'testAnnotationProcessor', 'testCompileOnly']
.each { conf -> add(conf, 'org.projectlombok:lombok:1.18.20') }

implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'com.miguelfonseca.completely:completely-core:0.9.0'
implementation 'com.vladsch.flexmark:flexmark:0.62.2'

testImplementation(platform('org.junit:junit-bom:5.7.2'))
testImplementation 'org.mockito:mockito-core:3.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
}

clean.doFirst {
delete 'build', 'out'
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
type = 'IC'
version = '2021.1.1'
pluginName = 'intellij-spring-assistant'
plugins = ['java', 'properties', 'yaml', 'maven', 'gradle']
updateSinceUntilBuild false
}

publishPlugin {
token System.getenv('IJ_PLUGIN_TOKEN')
// username System.getProperty('ij_plugin_portal_login')
// password System.getProperty('ij_plugin_portal_password')
channels 'eap', 'nightly', 'default'
}


patchPluginXml {
sinceBuild '203.1.0'
untilBuild '211.*'
pluginDescription readmeXmlAsHtml()
changeNotes changeLogAsHtml()
}

String readmeXmlAsHtml() {
Parser parser = Parser.builder().build()
HtmlRenderer renderer = HtmlRenderer.builder().build()
String readmeContent = new File(rootProject.uri('README.md')).text
final String readmeContent = new File(rootProject.uri('README.md')).text
// since these images needs to shown from within intellij, lest put absolute urls so that the images & changelog will be visible
readmeContent = readmeContent.replaceAll("help\\.gif", "https://raw.githubusercontent.com/1tontech/intellij-spring-assistant/" + version + "/help.gif")
readmeContent = readmeContent.replaceAll("CHANGELOG.md", "https://github.com/1tontech/intellij-spring-assistant/blob/" + version + "/CHANGELOG.md")
Document readmeDocument = parser.parse(readmeContent)
renderer.render(readmeDocument)
.replaceAll("help\\.gif", "https://raw.githubusercontent.com/1tontech/intellij-spring-assistant/" + version + "/help.gif")
.replaceAll("CHANGELOG.md", "https://github.com/1tontech/intellij-spring-assistant/blob/" + version + "/CHANGELOG.md")

final Document readmeDocument = Parser.builder().build().parse(readmeContent)
HtmlRenderer.builder().build().render(readmeDocument)
}

String changeLogAsHtml() {
Expand All @@ -65,18 +99,3 @@ String changeLogAsHtml() {
renderer.render(changeLogDocument)
}

intellij {
version 'IC-2017.2'
plugins = ['properties', 'yaml', 'maven', 'gradle', 'Lombook Plugin:0.16-2017.2']
downloadSources true
patchPluginXml {
pluginDescription readmeXmlAsHtml()
changeNotes changeLogAsHtml()
}
publishPlugin {
username System.getProperty('ij_plugin_portal_login')
password System.getProperty('ij_plugin_portal_password')
channels 'eap', 'nightly', 'default'
}
updateSinceUntilBuild false
}
Binary file added dist/intellij-spring-assistant-1.0.1.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name='intellij-spring-assistant'
group='in.oneton.idea.spring'
version='1.0.1'
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Feb 17 23:27:53 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
70 changes: 43 additions & 27 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
Expand Down Expand Up @@ -28,16 +44,16 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -66,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -109,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand All @@ -138,32 +156,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=`save "$@"`

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
cd "$(dirname "$0")"
fi
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
Loading