Skip to content

Commit

Permalink
Merge pull request #19 from abrugaro/add-gradle-analysis
Browse files Browse the repository at this point in the history
[RFR] Add Gradle analysis
  • Loading branch information
sshveta authored Jul 9, 2024
2 parents a4b7ceb + bef1a2c commit c3ea5b5
Show file tree
Hide file tree
Showing 31 changed files with 995 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,11 @@
"file_name": "camel-cbr",
"target": "camel4",
"source": "camel2"
},
"gradle-multi-project": {
"app_name": "gradle-multi-project",
"file_name": "gradle-multi-project-example",
"target": "azure-appservice",
"source": ""
}
}
105 changes: 105 additions & 0 deletions data/applications/gradle-multi-project-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
### Intellij+iml ###
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

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

.idea/

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

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

# Log file
*.log

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

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

### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### 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
28 changes: 28 additions & 0 deletions data/applications/gradle-multi-project-example/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>basic-gradle-template</name>
<comment>Project source created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>0</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=--init-script /org.eclipse.osgi/51/0/.cp/gradle/init/init.gradle
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/usr/lib/jvm/java-1.8.0-openjdk
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
21 changes: 21 additions & 0 deletions data/applications/gradle-multi-project-example/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [author]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions data/applications/gradle-multi-project-example/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: java -jar build/libs/template-server-all.jar
worker: java -jar build/libs/template-core-all.jar
53 changes: 53 additions & 0 deletions data/applications/gradle-multi-project-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# gradle-multi-project-example

Basic gradle template with subprojects, deployable to Heroku as separate dyno processes.

## What's included?

1. Gradle Plugins
- application plugin
- shadowjar plugin
2. Code Style
- checkstyle
- findbugs
- pmd
3. General Libraries
- guava
- junit
- mockito
- log4j2 via slf4j
4. Multi-Project Gradle Setup
- see: [settings.gradle](settings.gradle)
5. Heroku Deployment
- see: [Procfile](Procfile), [stage.gradle](gradle/heroku/stage.gradle)

## Development

### Building

```
$ ./gradlew clean build
```

### Testing

```
$ ./gradlew clean test
```

### Building Deployment Artifacts

```
$ ./gradlew clean stage
```

### Running

Use the Gradle [application plugin](https://docs.gradle.org/current/userguide/application_plugin.html).
However, `./gradlew run` will run applications in lexicographical order.
Instead, explicitly specify which subproject to run:

```
$ ./gradlew template-core:run
$ ./gradlew template-server:run
```
47 changes: 47 additions & 0 deletions data/applications/gradle-multi-project-example/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apply plugin: 'idea'

ext {
log4jVersion = '2.9.1'
}

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
}
}

allprojects {
repositories {
mavenLocal()
mavenCentral() // maven { url: 'http://jcenter.bintray.com' }
}
}

apply from: file('gradle/check.gradle')
apply from: file('gradle/heroku/clean.gradle')

subprojects {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'

group = "io.jeffchao.${rootProject.name}"

dependencies {
implementation 'com.google.guava:guava:23.0'

testImplementation 'junit:junit:4.12'

compile "org.apache.logging.log4j:log4j-api:$log4jVersion"
compile "org.apache.logging.log4j:log4j-core:$log4jVersion"
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"

testCompile 'org.mockito:mockito-core:2.11.0'

}

apply from: file("$rootProject.projectDir/gradle/heroku/stage.gradle")

}
Loading

0 comments on commit c3ea5b5

Please sign in to comment.