Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
66 changes: 31 additions & 35 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ jobs:
run-tests:
strategy:
matrix:
os: ["ubuntu:22.04", "almalinux:9"]
#os: ["ubuntu:22.04", "almalinux:9"]
os: ["almalinux:9"]
runs-on: ubuntu-latest
container:
image: ${{ matrix.os }}
steps:

- name: Install dependencies on Ubuntu 22.04
if: matrix.os == 'ubuntu:22.04'
if: matrix.os == 'ubuntu:20.04'
run: |
apt-get update -y
apt-get install -y default-jdk
apt-get install -y build-essential bison flex gettext texinfo automake autoconf libtool
apt update -y
apt install -y default-jdk
apt install -y build-essential bison flex gettext texinfo

- name: Install dependencies on AlmaLinux 9
if: matrix.os == 'almalinux:9'
Expand All @@ -38,13 +39,7 @@ jobs:
./configure --prefix=/usr/
make
make install
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"

- name: Make test scripts
run: |
cd tests/
make
cd ../
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"

- name: Run tests "command-line-options"
run: |
Expand All @@ -64,34 +59,34 @@ jobs:
run: |
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
cd tests/
./data-rep || true
./data-rep
cd ../

- name: Run tests "i18n_sjis"
run: |
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
cd tests/
./i18n_sjis || true
./i18n_sjis

- name: Run tests "jp-compat"
run: |
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
cd tests/
./jp-compat || true
./jp-compat
cd ../

#- name: Run tests "run"
# run: |
# export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
# cd tests/
# ./run || true
# cd ../
- name: Run tests "run"
run: |
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
cd tests/
./run
cd ../

- name: Run tests "syntax"
run: |
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
cd tests/
./syntax || true
./syntax
cd ../

- name: Run NIST test
Expand All @@ -100,26 +95,27 @@ jobs:
cd tests/cobol85/
make test

- name: Run tests "i18n_utf8"
run: |
export CLASSPATH=":$HOME/.java_lib/sqlite.jar"
./configure --prefix=/usr/ --with-vbisam --enable-utf8
make
make install
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
./i18n_utf8 || true
cd ../
#- name: Run tests "i18n_utf8"
# run: |
# export CLASSPATH=":$HOME/.java_lib/sqlite.jar"
# ./configure --prefix=/usr/ --with-vbisam --enable-utf8
# make
# make install
# export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
# ./i18n_utf8 || true
# cd ../

static_analysis:
runs-on: ubuntu-latest
steps:
# Checkout opensource COBOL
- name: Checkout opensource COBOL 4j
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get install default-jdk

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

# Download google-java-format and PMD
- name: Install dependencies
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-01-31 OSS Consortium <[email protected]>

* opensource COBOL 4J v1.0.7 released.

2022-12-29 OSS Consortium <[email protected]>

* opensource COBOL 4J v1.0.6 released.
Expand Down
34 changes: 26 additions & 8 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
NEWS - user visible changes -*- outline -*-

* opensource cobol 4j 1.0.6
* opensource COBOL 4J 1.0.7

** New Features
(1) Implement DELETE FILE statement of SEQUENTIAL files and LINE SEQUENTIAL files
(2) Improve Java interface, much better way to call COBOL from Java
(3) Add -java-package option
(4) Implement SET ENVIRONMENT statement

** Bug fixes
(1) Fix the bug involved with the environment variables COB_I_O_CREATE and COB_EXTEND_CREATE
(2) Fix the comparison process of COMP-3
(3) Fix EXIT PERFORM and EXIT PERFORM CYCLE

** Miscellaneous
(1) Format all Java source code in libcobj/ using Google Java Format

-----------------------------------------------------------------------

* opensource COBOL 4J 1.0.6

** New Features
(1) Add -fshort-variable option
Expand All @@ -14,7 +32,7 @@ NEWS - user visible changes -*- outline -*-

-----------------------------------------------------------------------

* opensource cobol 4j 1.0.5
* opensource COBOL 4J 1.0.5

** New Features
(1) -m option and cobjrun command (an experimental feature)
Expand Down Expand Up @@ -44,7 +62,7 @@ NEWS - user visible changes -*- outline -*-

-----------------------------------------------------------------------

* opensource cobol 4j 1.0.4
* opensource COBOL 4J 1.0.4

** New Features
(1) Rename cobc, the compile command, to cobj.
Expand Down Expand Up @@ -73,14 +91,14 @@ NEWS - user visible changes -*- outline -*-
-----------------------------------------------------------------------


* opensource cobol 4j 1.0.3
* opensource COBOL 4J 1.0.3

** New features
(1) Change the storage library for indexed file to SQLite.

-----------------------------------------------------------------------

* opensource cobol 4j 1.0.2
* opensource COBOL 4J 1.0.2

** New features
(1) Upgrade the license to GPL3.
Expand All @@ -90,21 +108,21 @@ NEWS - user visible changes -*- outline -*-

-----------------------------------------------------------------------

* opensource cobol 4j 1.0.1
* opensource COBOL 4J 1.0.1

** Bug fixes
(1) Fix the transformation of call arguments

-----------------------------------------------------------------------

* opensource cobol 4j 1.0.0
* opensource COBOL 4J 1.0.0

** Bug fixes
(1) Fix the status code after opening indexed files.
(2) Fix the behavior of delete and rewrite indexed files

-----------------------------------------------------------------------

* release opensource COBOL4J developers edition.
* release opensource COBOL 4J developers edition.

-----------------------------------------------------------------------
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# opensource COBOL 4J

[日本語版README](https://github.com/opensourcecobol/opensourcecobol4j/blob/main/README_JP.md)
[日本語版README](./README_JP.md)

"opensource COBOL 4J" is a COBOL compiler that translates COBOL parograms to Java programs.
This compiler is deeply inspired by ["opensource COBOL"](https://github.com/opensourcecobol/opensource-cobol) which translates COBOL programs to C programs.
Expand Down
2 changes: 1 addition & 1 deletion README_JP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# opensource COBOL 4J

[English version README](https://github.com/opensourcecobol/opensourcecobol4j/blob/main/README.md)
[English version README](./README.md)

opensource COBOL 4JはCOBOLソースコードをJavaソースコードに変換するCOBOLコンパイラです.
opensource COBOL 4JはCOBOLからCに変換するCOBOLコンパイラ["opensource COBOL"](https://github.com/opensourcecobol/opensource-cobol)をもとに開発されています.
Expand Down
36 changes: 22 additions & 14 deletions cobj/cobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ int cb_saveargc;
char **cb_saveargv;

const char *cob_config_dir;
extern char *cb_java_package_name = NULL;

#define PROGRAM_ID_LIST_MAX_LEN 1024
char* program_id_list[PROGRAM_ID_LIST_MAX_LEN];
Expand Down Expand Up @@ -296,6 +297,7 @@ static const struct option long_options[] = {
{"list-intrinsics", no_argument, NULL, '6'},
{"list-mnemonics", no_argument, NULL, 'q'},
{"save-temps", optional_argument, NULL, '_'},
{"java-package", optional_argument, NULL, 'P'},
{"std", required_argument, NULL, '$'},
{"conf", required_argument, NULL, '&'},
{"debug", no_argument, NULL, 'd'},
Expand Down Expand Up @@ -834,19 +836,20 @@ cobc_print_usage (void)
{
puts (_("Usage: cobj [options] file..."));
puts (_("Options:"));
puts (_(" --help Display this message"));
puts (_(" --version, -V Display compiler version"));
puts (_(" -m Create jar files instead of class files (an experimental feature)"));
puts (_(" -free Use free source format"));
puts (_(" -free_1col_aster Use free(1col_aster) source format"));
puts (_(" -g Enable Java compiler debug"));
puts (_(" -E Preprocess only; do not compile or link"));
puts (_(" -C Translation only; convert COBOL to Java"));
puts (_(" -t <file> Generate and place a program listing into <file>"));
puts (_(" -I <directory> Add <directory> to copy files search path"));
puts (_(" -B <options> Add <options> to the Java compiler"));
puts (_(" --list-reserved Display reserved words"));
puts (_(" -assign_external Set the file assign to external"));
puts (_(" --help Display this message"));
puts (_(" --version, -V Display compiler version"));
puts (_(" -m Create jar files instead of class files (an experimental feature)"));
puts (_(" -free Use free source format"));
puts (_(" -free_1col_aster Use free(1col_aster) source format"));
puts (_(" -g Enable Java compiler debug"));
puts (_(" -E Preprocess only; do not compile or link"));
puts (_(" -C Translation only; convert COBOL to Java"));
puts (_(" -t <file> Generate and place a program listing into <file>"));
puts (_(" -I <directory> Add <directory> to copy files search path"));
puts (_(" -B <options> Add <options> to the Java compiler"));
puts (_(" --list-reserved Display reserved words"));
puts (_(" -assign_external Set the file assign to external"));
puts (_(" -java-package(=<package name>) Specify the package name of the generated source code"));
putchar ('\n');

#undef CB_WARNDEF
Expand Down Expand Up @@ -1036,6 +1039,11 @@ process_command_line (const int argc, char *argv[])
}
}
break;
case 'P':
/* --java-package : Java package name to be written in the head of generated source code */
if(optarg) {
cb_java_package_name = optarg;
}

case '3': /* --constant */
if (optarg) {
Expand Down Expand Up @@ -1723,7 +1731,7 @@ process_compile (struct filename *fn)
}

for(char** program_id = program_id_list; *program_id; ++program_id) {
sprintf(buff, "javac %s -encoding SJIS %s.java",
sprintf(buff, "javac %s -encoding SJIS -d . %s.java",
cob_java_flags,
*program_id);
ret = process (buff);
Expand Down
2 changes: 2 additions & 0 deletions cobj/cobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ extern int cb_source_line;

extern const char *cob_config_dir;

extern char *cb_java_package_name;

extern char *source_name;
extern char *demangle_name;
extern FILE *cb_storage_file;
Expand Down
Loading