Skip to content

Commit

Permalink
Merge pull request #765 from jonbullock/fix/709-apple-silicon
Browse files Browse the repository at this point in the history
Upgrade to OrientDB v3.1.20 to allow JBake to run on Apple Silicon
  • Loading branch information
jonbullock committed Sep 19, 2022
2 parents 2e5a20b + 7aeb4c6 commit 3064f1c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ jobs:
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradlew') }}
restore-keys: |
${{ runner.os }}-gradlew-
- name: Build
- name: Build-win
if: runner.os == 'Windows'
shell: cmd
run: gradlew.bat -Dfile.encoding=UTF-8 build -S
- name: Build-nix
if: runner.os != 'Windows'
run: ./gradlew build -S

- name: Upload Reports
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jade4jVersion = 1.3.2
jsoupVersion = 1.14.3
jgitVersion = 6.0.0.202111291000-r
logbackVersion = 1.2.10
orientDbVersion = 3.0.41
orientDbVersion = 3.1.20
pebbleVersion = 3.1.5
slf4jVersion = 1.7.32
snakeYamlVersion = 1.30
Expand Down
5 changes: 5 additions & 0 deletions jbake-core/src/main/java/org/jbake/app/DBUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.jbake.app.configuration.JBakeConfiguration;
import org.jbake.model.DocumentModel;

import java.util.ArrayList;

public class DBUtil {
private static ContentStore contentStore;

Expand Down Expand Up @@ -56,6 +58,9 @@ public static String[] toStringArray(Object entry) {
} else if (entry instanceof OTrackedList) {
OTrackedList<String> list = (OTrackedList<String>) entry;
return list.toArray(new String[list.size()]);
} else if (entry instanceof ArrayList) {
ArrayList<String> list = (ArrayList<String>) entry;
return list.toArray(new String[list.size()]);
}
return new String[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public static void setUpClass() throws Exception {

Assert.assertEquals(".html", config.getOutputExtension());
config.setDatabaseStore(storageType.toString());
String dbPath = folder.newFolder("documents" + System.currentTimeMillis()).getAbsolutePath();
// OrientDB v3.1.x doesn't allow DB name to be a path even though docs say it's allowed
String dbPath = folder.newFolder("documents" + System.currentTimeMillis()).getName();

// setting the database path with a colon creates an invalid url for OrientDB.
// only one colon is expected. there is no documentation about proper url path for windows available :(
Expand Down
4 changes: 2 additions & 2 deletions jbake-core/src/test/java/org/jbake/app/CrawlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public void crawlDataFiles() {
Assert.assertFalse(authorsFileContents.isEmpty());
Object authorsList = authorsFileContents.get("authors");
assertThat(authorsList).isNotInstanceOf(OTrackedMap.class);
assertThat(authorsList).isInstanceOf(LinkedHashMap.class);
LinkedHashMap<String, Map<String, Object>> authors = (LinkedHashMap<String, Map<String, Object>>) authorsList;
assertThat(authorsList).isInstanceOf(HashMap.class);
HashMap<String, Map<String, Object>> authors = (HashMap<String, Map<String, Object>>) authorsList;
assertThat(authors.get("Joe Bloggs").get("last_name")).isEqualTo("Bloggs");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@

public class GroovyMarkupTemplateEngineRenderingTest extends AbstractTemplateEngineRenderingTest {

@BeforeClass
public static void setUpTest() {
//switch to PLOCAL mode for this test class as Travis sometimes runs out of memory
db.close();
config.setDatabaseStore(StorageType.PLOCAL.toString());
db = DBUtil.createDataStore(config);
}

public GroovyMarkupTemplateEngineRenderingTest() {
super("groovyMarkupTemplates", "tpl");

Expand Down

0 comments on commit 3064f1c

Please sign in to comment.