Skip to content

Commit

Permalink
Merge pull request #402 from smeup/release/1.3.0
Browse files Browse the repository at this point in the history
Bump 1.3.0 version
  • Loading branch information
mattiabonardi authored Jan 18, 2024
2 parents d0c42cf + 4e8030f commit 4e33d94
Show file tree
Hide file tree
Showing 116 changed files with 3,976 additions and 777 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CIBuild

on: [push]
on:
push:
workflow_dispatch:

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-smeup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Deploy to internal smeup nexus
on:
push:
branches: ['master', 'develop']
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Deploy to maven central
on:
push:
branches: [master, develop]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
Expand Down
24 changes: 0 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,37 +73,13 @@ subprojects {
project.group = jarikoGroupId
project.version = jarikoVersion

// specifying what we want to sign
signing {
if (!project.hasProperty("signing.keyId")) {
println "$project.name - Signing disabled because signing.keyId property is not present, it is not an error!!!"
}
required { project.hasProperty("signing.keyId") }
sign configurations.archives
}

publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
}
}
}

model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}
tasks.publishMavenJavaPublicationToSonatypeRepository{
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToSmeupRepository{
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToMavenLocal{
dependsOn project.tasks.signArchives
}
}
}

nexusPublishing {
Expand Down
33 changes: 8 additions & 25 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,18 @@ publishing {
groupId jarikoGroupId
artifactId 'examples'
version jarikoVersion
//version 'develop-SNAPSHOT'

// create the sign pom artifact
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}

// create the signed artifacts
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
}
}
}

signing {
if (!project.hasProperty("signing.keyId")) {
println "$project.name - Signing disabled because signing.keyId property is not present, it is not an error!!!"
}
required { project.hasProperty("signing.keyId") }
sign publishing.publications.mavenJava
}

java {
withJavadocJar()
withSourcesJar()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ serializationVersion=1.5.0
jvmVersion=11
reloadVersion=v1.3.2
jarikoGroupId=io.github.smeup.jariko
jarikoVersion=v1.2.0
jarikoVersion=v1.3.0
32 changes: 8 additions & 24 deletions kolasu/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,34 +90,18 @@ publishing {
groupId jarikoGroupId
artifactId 'kolasu'
version jarikoVersion

// create the sign pom artifact
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}

// create the signed artifacts
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
}
}
}

signing {
if (!project.hasProperty("signing.keyId")) {
println "$project.name - Signing disabled because signing.keyId property is not present, it is not an error!!!"
}
required { project.hasProperty("signing.keyId") }
sign publishing.publications.mavenJava
}

java {
withJavadocJar()
withSourcesJar()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ fun Node.find(predicate: (Node) -> Boolean): Node? {
return null
}

/**
* Navigate the abstract syntax tree and execute the operation on all the nodes of the given type.
* */
fun <T : Node> Node.specificProcess(klass: Class<T>, operation: (T) -> Unit) {
process { if (klass.isInstance(it)) {
operation(it as T) }
Expand Down
32 changes: 8 additions & 24 deletions rpgJavaInterpreter-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -410,34 +410,18 @@ publishing {
groupId jarikoGroupId
artifactId 'rpgJavaInterpreter-core'
version jarikoVersion

// create the sign pom artifact
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
artifact(pomAscFile) {
classifier = null
extension = 'pom.asc'
}
}

// create the signed artifacts
project.tasks.signArchives.signatureFiles.each {
artifact(it) {
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
if (matcher.find()) {
classifier = matcher.group(1)
} else {
classifier = null
}
extension = 'jar.asc'
}
}
}
}
}

signing {
if (!project.hasProperty("signing.keyId")) {
println "$project.name - Signing disabled because signing.keyId property is not present, it is not an error!!!"
}
required { project.hasProperty("signing.keyId") }
sign publishing.publications.mavenJava
}

java {
withJavadocJar()
withSourcesJar()
Expand Down
2 changes: 1 addition & 1 deletion rpgJavaInterpreter-core/src/main/antlr/RpgLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ mode FIXED_DefSpec;
BLANK_SPEC :
' '
{getCharPositionInLine()==81}?;
CONTINUATION_NAME : {getCharPositionInLine()<21}? [ ]* NAMECHAR+ CONTINUATION {setText(getText().substring(0,getText().length()-3).trim());} -> pushMode(CONTINUATION_ELIPSIS) ;
CONTINUATION_NAME : {getCharPositionInLine()<21 && getCharPositionInLine()>=81}? [ ]* NAMECHAR+ CONTINUATION {setText(getText().substring(0,getText().length()-3).trim());} -> pushMode(CONTINUATION_ELIPSIS) ;
CONTINUATION : '...' ;
NAME : NAME5 NAME5 NAME5 {getCharPositionInLine()==21}? {setText(getText().trim());};
EXTERNAL_DESCRIPTION: [eE ] {getCharPositionInLine()==22}? ;
Expand Down
3 changes: 2 additions & 1 deletion rpgJavaInterpreter-core/src/main/antlr/RpgParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ bif_parmnum: BIF_PARMNUM OPEN_PAREN identifier CLOSE_PAREN;
bif_realloc: BIF_REALLOC OPEN_PAREN ptr=identifier COLON num=expression CLOSE_PAREN;
bif_rem: BIF_REM OPEN_PAREN numerator=expression COLON denominator=expression CLOSE_PAREN;
bif_replace: BIF_REPLACE OPEN_PAREN replacement=expression COLON source=expression (COLON start=expression (COLON length=expression)? )? CLOSE_PAREN;
bif_scan: BIF_SCAN OPEN_PAREN searcharg=expression COLON source=expression (COLON start=expression )? CLOSE_PAREN;
bif_scan: BIF_SCAN OPEN_PAREN searcharg=expression COLON source=expression (COLON start=expression )? (COLON length=expression )? CLOSE_PAREN;
bif_scanrpl: BIF_SCANRPL OPEN_PAREN scanstring=expression COLON replacement=expression COLON source=expression (COLON start=expression (COLON length=expression)? )? CLOSE_PAREN;
bif_seconds: BIF_SECONDS OPEN_PAREN numberexpression=expression CLOSE_PAREN;
bif_shtdn: BIF_SHTDN;
Expand Down Expand Up @@ -2642,6 +2642,7 @@ target:
| container=idOrKeyword FREE_DOT field=idOrKeyword #qualifiedTarget
| base=target OPEN_PAREN index=expression CLOSE_PAREN #indexedTarget
| bif_subst #substTarget
| bif_subarr #subarrTarget
| container=idOrKeyword DOT fieldName=idOrKeyword #qualifiedTarget
| indic=SPLAT_INDICATOR #indicatorTarget
| SPLAT_IN #globalIndicatorTarget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@

public class EBCDICComparator implements Comparator<String> {

private final String EBCDIC_CODE = "CP037";
private final Charset STANDARD_CHARSET = StandardCharsets.ISO_8859_1;
private int order = 1;

public EBCDICComparator() {
}

public EBCDICComparator(boolean descend) {
if (descend)
order = -1;
Expand All @@ -44,6 +40,7 @@ public int compare(String s1, String s2) {
byte[] b1;
byte[] b2;
try {
String EBCDIC_CODE = "CP037";
b1 = s1.getBytes(EBCDIC_CODE);
b2 = s2.getBytes(EBCDIC_CODE);
} catch (UnsupportedEncodingException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ data class Options(
* @param onEnterFunction It is invoked on function enter after symboltable initialization.
* @param onExitFunction It is invoked on function exit, only if the function does not throw any error
* @param onError It is invoked in case of errors. The default implementation writes error event in stderr
* @param onCallPgmError It is invoked in case of runtime errors accurred inside the program called only if the error indicator
* at column 73-74 is specified. The default implementation does nothing
* @param logInfo If specified, it is invoked to log information messages, for all channel enabled
* @param channelLoggingEnabled If specified, it allows to enable programmatically the channel logging.
* For instance, you can enable all channels by using [consoleVerboseConfiguration] but you can decide, through
Expand Down Expand Up @@ -158,6 +160,7 @@ data class JarikoCallback(
}
} ?: System.err.println(errorEvent)
},
var onCallPgmError: (errorEvent: ErrorEvent) -> Unit = { },
var logInfo: ((channel: String, message: String) -> Unit)? = null,
var channelLoggingEnabled: ((channel: String) -> Boolean)? = null
)
Expand All @@ -180,7 +183,7 @@ data class CallProgramHandler(
data class ErrorEvent(val error: Throwable, val errorEventSource: ErrorEventSource, val absoluteLine: Int?, val sourceReference: SourceReference?) {

/**
Re * The source code line from which the error event has been fired.
* The source code line from which the error event has been fired.
* Could be null
* */
val fragment = absoluteLine?.let { line ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,51 +64,61 @@ class DBFileMap {
* */
data class EnrichedDBFile(private val dbFile: DBFile, private val fileDefinition: FileDefinition, val jarikoMetadata: FileMetadata) : DBFile {

// All files are opened by default when defined in F specs.
var open = true

override var fileMetadata = dbFile.fileMetadata

override var name = dbFile.name

override var logger = dbFile.logger

override fun chain(key: String) = dbFile.chain(key).validate()
override fun chain(key: String) = checkOpened().chain(key).validate()

override fun chain(keys: List<String>) = dbFile.chain(keys).validate()
override fun chain(keys: List<String>) = checkOpened().chain(keys).validate()

override fun delete(record: Record) = dbFile.delete(record).validate()
override fun delete(record: Record) = checkOpened().delete(record).validate()

override fun eof() = dbFile.eof()
override fun eof() = checkOpened().eof()

override fun equal() = dbFile.equal()
override fun equal() = checkOpened().equal()

override fun read() = dbFile.read().validate()
override fun read() = checkOpened().read().validate()

override fun readEqual() = dbFile.readEqual().validate()
override fun readEqual() = checkOpened().readEqual().validate()

override fun readEqual(key: String) = dbFile.readEqual(key).validate()
override fun readEqual(key: String) = checkOpened().readEqual(key).validate()

override fun readEqual(keys: List<String>) = dbFile.readEqual(keys).validate()
override fun readEqual(keys: List<String>) = checkOpened().readEqual(keys).validate()

override fun readPrevious() = dbFile.readPrevious().validate()
override fun readPrevious() = checkOpened().readPrevious().validate()

override fun readPreviousEqual() = dbFile.readPreviousEqual().validate()
override fun readPreviousEqual() = checkOpened().readPreviousEqual().validate()

override fun readPreviousEqual(key: String) = dbFile.readPreviousEqual(key).validate()
override fun readPreviousEqual(key: String) = checkOpened().readPreviousEqual(key).validate()

override fun readPreviousEqual(keys: List<String>) = dbFile.readPreviousEqual(keys).validate()
override fun readPreviousEqual(keys: List<String>) = checkOpened().readPreviousEqual(keys).validate()

override fun setgt(key: String) = dbFile.setgt(key)
override fun setgt(key: String) = checkOpened().setgt(key)

override fun setgt(keys: List<String>) = dbFile.setgt(keys)
override fun setgt(keys: List<String>) = checkOpened().setgt(keys)

override fun setll(key: String) = dbFile.setll(key)
override fun setll(key: String) = checkOpened().setll(key)

override fun setll(keys: List<String>) = dbFile.setll(keys)
override fun setll(keys: List<String>) = checkOpened().setll(keys)

override fun update(record: Record) = dbFile.update(record).validate()
override fun update(record: Record) = checkOpened().update(record).validate()

override fun write(record: Record) = dbFile.write(record).validate()
override fun write(record: Record) = checkOpened().write(record).validate()

fun getDataDefinitionName(dbFieldName: String) = fileDefinition.getDataDefinitionName(dbFieldName)

private fun checkOpened(): DBFile {
require(open) {
"Cannot access to closed file $name"
}
return dbFile
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ interface Evaluator {
fun eval(expression: NotExpr): BooleanValue
fun eval(expression: ScanExpr): Value
fun eval(expression: SubstExpr): Value
fun eval(expression: SubarrExpr): Value
fun eval(expression: LenExpr): Value
fun eval(expression: OffRefExpr): BooleanValue
fun eval(expression: IndicatorExpr): BooleanValue
Expand All @@ -76,4 +77,5 @@ interface Evaluator {
fun eval(expression: AssignmentExpr): Value
fun eval(expression: GlobalIndicatorExpr): Value
fun eval(expression: ParmsExpr): Value
fun eval(expression: OpenExpr): Value
}
Loading

0 comments on commit 4e33d94

Please sign in to comment.