Skip to content

Commit

Permalink
Create makefiles in IBM-1047 encoding for JDK21+ on z/OS
Browse files Browse the repository at this point in the history
  • Loading branch information
psoujany committed Dec 9, 2024
1 parent 2c8d222 commit a43e10d
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/org/openj9/envInfo/EnvDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.io.IOException;
import java.io.BufferedWriter;
import java.io.Writer;

import org.testKitGen.MkGen;

public class EnvDetector {
static boolean isMachineInfo = false;
Expand Down Expand Up @@ -51,6 +53,7 @@ private static void parseArgs(String[] args) {
*/
private static void getJavaInfo() {

MkGen mg = new MkGen(null, null, null, null, null, null);
JavaInfo envDetection = new JavaInfo();
String javaImplInfo = envDetection.getJDKImpl();
String vendorInfo = envDetection.getJDKVendor();
Expand Down Expand Up @@ -81,14 +84,9 @@ private static void getJavaInfo() {
/**
* autoGenEnv.mk file will be created to store auto detected java info.
*/
BufferedWriter output = null;
Writer output = null;
try {
if (JDK_VERSION.matches("2\\d") && SPECInfo.contains("zos")) {
output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("autoGenEnv.mk"), Charset.forName("IBM-1047")));
System.out.println("I'm in 21");
} else {
output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("autoGenEnv.mk")));
}
output = mg.getWriterObject("autoGenEnv.mk");
output.write("########################################################\n");
output.write("# This is an auto generated file. Please do NOT modify!\n");
output.write("########################################################\n");
Expand All @@ -100,11 +98,7 @@ private static void getJavaInfo() {
output.write(JDK_VENDOR);
output.write(TEST_FLAG);
output.close();
if (JDK_VERSION.matches("2\\d") && SPECInfo.contains("zos")) {
output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("AQACert.log"), Charset.forName("IBM-1047")));
} else {
output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("AQACert.log")));
}
output = mg.getWriterObject("AQACert.log");
output.write(JAVA_VERSION);
output.write(RELEASE_INFO);
output.close();
Expand Down

0 comments on commit a43e10d

Please sign in to comment.