Skip to content

Commit

Permalink
Added boilerplate code that includes refactoring miner & git4idea dep…
Browse files Browse the repository at this point in the history
…endencies, .gitignore and .yml files.
  • Loading branch information
ioana committed Apr 26, 2020
1 parent b5987f1 commit 854b3af
Show file tree
Hide file tree
Showing 11 changed files with 713 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.idea/
/.gradle/
/build/
52 changes: 52 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
image: gradle:6.0-jdk13

stages:
- build
- validate
# - test
# - coverage

variables:
# Disable the Gradle daemon to ensure isolated runs of the CI pipeline.
GRADLE_OPTS: "-Dorg.gradle.daemon=false"

before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle

build:
stage: build
script:
gradle --build-cache assemble
cache:
key: "$CI_COMMIT_REF_NAME"
policy: push
paths:
- build/
- .gradle/

checkStyle:
stage: validate
script: gradle checkstyleMain checkstyleTest
cache:
key: "$CI_COMMIT_REF_NAME"
policy: pull
paths:
- build/
- .gradle/
#
#test:
# stage: test
# artifacts:
# untracked: true
# script:
# gradle check
#
#coverage:
# stage: coverage
# dependencies:
# - test
# script:
# - coverage=$(awk -F"," '{ branches += $6 + $7; covered += $7 } END { print "Total" ,int(100*covered/branches), "%% covered" }' build/JaCoCo/test/jacocoTestReport.csv)
# # - aggregate=$(awk -F"," '{ branches += $6 + $7; covered += $7 } END { print "\nAGGREGATE COVERAGE REPORT"; print covered, "/", branches, "branches covered"; print int(100*covered/branches), "%% covered\n---------------------------\n" }' target/site/jacoco-aggregate/jacoco.csv)
# - printf "$coverage"
# coverage: '/Total *?([0-9]{1,3}) %/'
77 changes: 77 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
plugins {
id 'java'
id 'checkstyle'
id 'jacoco'
id 'org.jetbrains.intellij' version '0.4.18'
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}


test {
useJUnitPlatform()
}

jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile group: 'junit', name: 'junit', version: '4.12'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
implementation files('lib/RefactoringMiner.jar')
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version '2020.1'
plugins 'java', 'git4idea'
}


checkstyle {
toolVersion "8.25"
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
kotlin {
/* Targets configuration omitted.
* To find out how to configure the targets, please follow the link:
* https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets */

sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
}
}
patchPluginXml {
changeNotes """
Add change notes here.<br>
<em>most HTML tags may be used</em>"""
}
Loading

0 comments on commit 854b3af

Please sign in to comment.