Skip to content

Commit 2c149c8

Browse files
Merge pull request #64 from yutaro-sakamoto/v1.0.6
Release v1.0.6
2 parents a665914 + b97043d commit 2c149c8

File tree

83 files changed

+19920
-17530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+19920
-17530
lines changed

.github/ruleset.xml

Lines changed: 322 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/cicd.yml

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,29 @@ on:
66

77
jobs:
88
run-tests:
9+
strategy:
10+
matrix:
11+
os: ["ubuntu:22.04", "almalinux:9"]
912
runs-on: ubuntu-latest
13+
container:
14+
image: ${{ matrix.os }}
1015
steps:
11-
# Checkout opensource COBOL
12-
- name: Checkout opensource COBOL 4j
13-
uses: actions/checkout@v2
1416

15-
- name: Install dependencies
17+
- name: Install dependencies on Ubuntu 22.04
18+
if: matrix.os == 'ubuntu:22.04'
1619
run: |
17-
sudo apt-get update
18-
sudo apt-get install default-jdk
19-
sudo apt-get install -y build-essential bison flex gettext texinfo
20+
apt-get update -y
21+
apt-get install -y default-jdk
22+
apt-get install -y build-essential bison flex gettext texinfo automake autoconf libtool
23+
24+
- name: Install dependencies on AlmaLinux 9
25+
if: matrix.os == 'almalinux:9'
26+
run: |
27+
dnf -y update
28+
dnf install -y java-17-openjdk-devel gcc gcc-c++ make bison flex automake autoconf libtool diffutils gettext
29+
30+
- name: Checkout opensource COBOL 4j
31+
uses: actions/checkout@v2
2032

2133
- name: Install opensource COBOL 4j
2234
run: |
@@ -25,9 +37,8 @@ jobs:
2537
export CLASSPATH=":$HOME/.java_lib/sqlite.jar"
2638
./configure --prefix=/usr/
2739
make
28-
sudo make install
29-
cp libcobj/build/libcobj.jar ~/.java_lib
30-
export CLASSPATH="$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
40+
make install
41+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
3142
3243
- name: Make test scripts
3344
run: |
@@ -37,55 +48,55 @@ jobs:
3748
3849
- name: Run tests "command-line-options"
3950
run: |
40-
export CLASSPATH=":$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
51+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
4152
cd tests/
4253
./command-line-options
4354
cd ../
4455
4556
- name: Run tests "misc"
4657
run: |
47-
export CLASSPATH=":$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
58+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
4859
cd tests/
4960
./misc
5061
cd ../
5162
5263
- name: Run tests "data-rep"
5364
run: |
54-
export CLASSPATH=":$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
65+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
5566
cd tests/
5667
./data-rep || true
5768
cd ../
5869
5970
- name: Run tests "i18n_sjis"
6071
run: |
61-
export CLASSPATH=":$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
72+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
6273
cd tests/
6374
./i18n_sjis || true
6475
6576
- name: Run tests "jp-compat"
6677
run: |
67-
export CLASSPATH=":$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
78+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
6879
cd tests/
6980
./jp-compat || true
7081
cd ../
7182
7283
#- name: Run tests "run"
7384
# run: |
74-
# export CLASSPATH=":$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
85+
# export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
7586
# cd tests/
7687
# ./run || true
7788
# cd ../
7889

7990
- name: Run tests "syntax"
8091
run: |
81-
export CLASSPATH=":$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
92+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
8293
cd tests/
8394
./syntax || true
8495
cd ../
8596
8697
- name: Run NIST test
8798
run: |
88-
export CLASSPATH=":$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
99+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
89100
cd tests/cobol85/
90101
make test
91102
@@ -94,8 +105,34 @@ jobs:
94105
export CLASSPATH=":$HOME/.java_lib/sqlite.jar"
95106
./configure --prefix=/usr/ --with-vbisam --enable-utf8
96107
make
97-
sudo make install
98-
cp libcobj/build/libcobj.jar ~/.java_lib
99-
export CLASSPATH=":$HOME/.java_lib/libcobj.jar:$HOME/.java_lib/sqlite.jar"
108+
make install
109+
export CLASSPATH=":/usr/lib/opensourcecobol4j/libcobj.jar:$HOME/.java_lib/sqlite.jar"
100110
./i18n_utf8 || true
101111
cd ../
112+
113+
static_analysis:
114+
runs-on: ubuntu-latest
115+
steps:
116+
# Checkout opensource COBOL
117+
- name: Checkout opensource COBOL 4j
118+
uses: actions/checkout@v2
119+
120+
- name: Install dependencies
121+
run: |
122+
sudo apt-get install default-jdk
123+
124+
# Download google-java-format and PMD
125+
- name: Install dependencies
126+
run: |
127+
curl -L -o google-java-format.jar https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar
128+
curl -L -o pmd-bin-6.52.0.zip https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.52.0/pmd-bin-6.52.0.zip
129+
unzip pmd-bin-6.52.0.zip
130+
131+
- name: Check format with google-java-format
132+
run: |
133+
export PATH_GOOGLE_JAVA_FORMAT=${PWD}/google-java-format.jar
134+
./check-format
135+
136+
- name: Run PMD
137+
run: |
138+
pmd-bin-6.52.0/bin/run.sh pmd -d ${PWD}/libcobj/src -R ${PWD}/.github/ruleset.xml -f text || true

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ libcob/Makefile
2020
libcob/*.la
2121
libcob/*.lo
2222
libcob/*.o
23-
libcobj/build/
23+
libcobj/jp
24+
libcobj/build
25+
libcobj/libcobj.jar
2426
libtool
2527
m4/libtool.m4
2628
m4/ltoptions.m4

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2022-12-29 OSS Consortium <[email protected]>
2+
3+
* opensource COBOL 4J v1.0.6 released.
4+
15
2022-11-22 OSS Consortium <[email protected]>
26

37
* opensource COBOL 4J v1.0.5 released.

NEWS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
NEWS - user visible changes -*- outline -*-
22

3+
* opensource cobol 4j 1.0.6
4+
5+
** New Features
6+
(1) Add -fshort-variable option
7+
(2) make install command installs libcobj.jar in ${prefix}/lib/opensourcecobol4j
8+
9+
** Bug fixes
10+
(1) Fix FUNCTION CURRENT-DATE
11+
12+
** Miscellaneous
13+
(1) Build and run tests on AlmaLinux 9
14+
15+
-----------------------------------------------------------------------
16+
317
* opensource cobol 4j 1.0.5
418

519
** New Features

check-format

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
cd libcobj && ./check-format

cobj/codegen.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ get_java_identifier_field(struct cb_field* f) {
185185
char *buf = malloc(COB_SMALL_BUFF);
186186
if(cb_flag_serial_variable) {
187187
sprintf(buf, "%s%d", CB_PREFIX_FIELD, f->id);
188+
} else if(cb_flag_short_variable) {
189+
strcpy(buf, CB_PREFIX_FIELD);
190+
strcpy_identifier_cobol_to_java(buf + strlen(CB_PREFIX_FIELD), f->name);
188191
} else {
189192
strcpy(buf, CB_PREFIX_FIELD);
190193
get_java_identifier_helper(f, buf + strlen(CB_PREFIX_FIELD));
@@ -197,6 +200,9 @@ get_java_identifier_base(struct cb_field* f) {
197200
char *buf = malloc(COB_SMALL_BUFF);
198201
if(cb_flag_serial_variable) {
199202
sprintf(buf, "%s%d", CB_PREFIX_BASE, f->id);
203+
} else if(cb_flag_short_variable) {
204+
strcpy(buf, CB_PREFIX_BASE);
205+
strcpy_identifier_cobol_to_java(buf + strlen(CB_PREFIX_BASE), f->name);
200206
} else {
201207
strcpy(buf, CB_PREFIX_BASE);
202208
get_java_identifier_helper(f, buf + strlen(CB_PREFIX_BASE));

cobj/flag-help.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ CB_FLAG (cb_flag_syntax_only, "syntax-only",
3636

3737
CB_FLAG (cb_flag_serial_variable, "serial-variable",
3838
N_("Instead of embedding COBOL variable names in Java variable names, give them serial numbers."))
39+
40+
CB_FLAG (cb_flag_short_variable, "short-variable",
41+
N_("Use short variable names in Java source code. This feature may cause compilation errors"))

cobj/flag.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,6 @@ CB_FLAG (cb_flag_null_param, "null-param",
7474

7575
CB_FLAG (cb_flag_serial_variable, "serial-variable",
7676
N_("Instead of embedding COBOL variable names in Java variable names, give them serial numbers."))
77+
78+
CB_FLAG (cb_flag_short_variable, "short-variable",
79+
N_("Use short variable names in Java source code. This feature may cause compilation errors"))

configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22933,7 +22933,7 @@ COB_BIGENDIAN="$ac_cv_c_bigendian"
2293322933

2293422934

2293522935

22936-
ac_config_files="$ac_config_files bin/cob-config Makefile lib/Makefile cobj/Makefile bin/Makefile po/Makefile.in texi/Makefile config/Makefile copy/Makefile tests/atlocal tests/Makefile tests/cobol85/Makefile"
22936+
ac_config_files="$ac_config_files bin/cob-config Makefile lib/Makefile cobj/Makefile bin/Makefile po/Makefile.in texi/Makefile config/Makefile libcobj/Makefile copy/Makefile tests/atlocal tests/Makefile tests/cobol85/Makefile"
2293722937

2293822938

2293922939
ac_config_commands="$ac_config_commands chmod1"
@@ -24167,6 +24167,7 @@ do
2416724167
"po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
2416824168
"texi/Makefile") CONFIG_FILES="$CONFIG_FILES texi/Makefile" ;;
2416924169
"config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;;
24170+
"libcobj/Makefile") CONFIG_FILES="$CONFIG_FILES libcobj/Makefile" ;;
2417024171
"copy/Makefile") CONFIG_FILES="$CONFIG_FILES copy/Makefile" ;;
2417124172
"tests/atlocal") CONFIG_FILES="$CONFIG_FILES tests/atlocal" ;;
2417224173
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;

0 commit comments

Comments
 (0)