Skip to content

Commit

Permalink
Java Interface:
Browse files Browse the repository at this point in the history
- JarCreator: Check if file already exists, and throw exception.
  + This happens on Windows systems if uniontypes and records have the same case-insensitive name.
- DefinitionsCreator: Fix for when OPENMODELICA environment-variable doesn't contain a trailing directory-separator.
- The Java testsuite now generates files in the proper order, but doesn't work on Windows due to case-insensitivity issues.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4799 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 18, 2010
1 parent e4a2a8d commit 32c26a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -22,8 +22,9 @@ private static File writeSTResult(StringTemplate st, File basepath, String basep
String filename = String.format("%s/%s/%s%s.java", basepath.getAbsolutePath(), basepackage.replace('.', '/'), (packagename != null ? packagename.replace('.', '/')+"/" : ""), classname);
File f = new File(filename);
try {
f.mkdirs();
f.delete();
f.getParentFile().mkdirs();
if (f.exists())
throw new RuntimeException(f + ": File already exists");
f.createNewFile();
FileWriter fw = new FileWriter(f);
fw.write(st.toString());
Expand Down
Expand Up @@ -87,7 +87,7 @@ private static void compileSources(File basePath, List<File> sourceFiles) {
}

for (File sourceFile : sourceFiles) {
if (javac.run(null, null, null, "-classpath", System.getenv("OPENMODELICAHOME") + "share/java/modelica_java.jar","-sourcepath", basePath.getAbsolutePath(), sourceFile.getAbsolutePath()) != 0)
if (javac.run(null, null, null, "-classpath", System.getenv("OPENMODELICAHOME") + "/share/java/modelica_java.jar","-sourcepath", basePath.getAbsolutePath(), sourceFile.getAbsolutePath()) != 0)
throw new RuntimeException("Failed to compile " + sourceFile);
}
}
Expand Down

0 comments on commit 32c26a8

Please sign in to comment.