-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add implementation for compiler plugin
- Loading branch information
1 parent
30fb9e4
commit 8b2f215
Showing
29 changed files
with
1,266 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[plugin] | ||
id = "constraint-compiler-plugin" | ||
class = "io.ballerina.stdlib.data.csvdata.compiler.CsvDataCompilerPlugin" | ||
|
||
[[dependency]] | ||
path = "../compiler-plugin/build/libs/data.csv-compiler-plugin-@project.version@.jar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you 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 | ||
* | ||
* http://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. | ||
*/ | ||
|
||
plugins { | ||
id 'java' | ||
id 'checkstyle' | ||
id 'com.github.spotbugs' | ||
} | ||
|
||
description = 'Ballerina - Csv Compiler Plugin Tests' | ||
|
||
dependencies { | ||
checkstyle project(':checkstyle') | ||
checkstyle "com.puppycrawl.tools:checkstyle:${puppycrawlCheckstyleVersion}" | ||
|
||
implementation project(':data.csv-compiler-plugin') | ||
|
||
testImplementation group: 'org.ballerinalang', name: 'ballerina-lang', version: "${ballerinaLangVersion}" | ||
testImplementation group: 'org.ballerinalang', name: 'ballerina-tools-api', version: "${ballerinaLangVersion}" | ||
testImplementation group: 'org.ballerinalang', name: 'ballerina-parser', version: "${ballerinaLangVersion}" | ||
testImplementation group: 'org.testng', name: 'testng', version: "${testngVersion}" | ||
} | ||
|
||
tasks.withType(Checkstyle) { | ||
exclude '**/module-info.java' | ||
} | ||
|
||
checkstyle { | ||
toolVersion "${project.puppycrawlCheckstyleVersion}" | ||
configFile rootProject.file("build-config/checkstyle/build/checkstyle.xml") | ||
configProperties = ["suppressionFile" : file("${rootDir}/build-config/checkstyle/build/suppressions.xml")] | ||
} | ||
|
||
checkstyleTest.dependsOn(":checkstyle:downloadCheckstyleRuleFiles") | ||
|
||
spotbugsTest { | ||
effort "max" | ||
reportLevel "low" | ||
reportsDir = file("$project.buildDir/reports/spotbugs") | ||
reports { | ||
html.enabled true | ||
text.enabled = true | ||
} | ||
def excludeFile = file("${project.projectDir}/spotbugs-exclude.xml") | ||
if(excludeFile.exists()) { | ||
excludeFilter = excludeFile | ||
} | ||
} | ||
|
||
spotbugsMain { | ||
enabled false | ||
} | ||
|
||
checkstyleMain { | ||
enabled false | ||
} | ||
|
||
compileJava { | ||
doFirst { | ||
options.compilerArgs = [ | ||
'--module-path', classpath.asPath, | ||
] | ||
classpath = files() | ||
} | ||
} | ||
|
||
test { | ||
systemProperty "ballerina.offline.flag", "true" | ||
useTestNG() | ||
finalizedBy jacocoTestReport | ||
|
||
testLogging { | ||
exceptionFormat = "full" | ||
afterSuite { desc, result -> | ||
if (!desc.parent) { // will match the outermost suite | ||
def output = "Compiler Plugin Tests: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)" | ||
def startItem = '| ', endItem = ' |' | ||
def repeatLength = startItem.length() + output.length() + endItem.length() | ||
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) | ||
} | ||
} | ||
} | ||
} | ||
|
||
jacocoTestReport { | ||
dependsOn test | ||
reports { | ||
xml.required = true | ||
} | ||
sourceSets project(':data.csv-compiler-plugin').sourceSets.main | ||
} | ||
|
||
test.dependsOn ":data.csv-ballerina:build" |
Oops, something went wrong.