Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Commit

Permalink
version set to 0.2.0 for release
Browse files Browse the repository at this point in the history
  • Loading branch information
delchev committed Feb 26, 2021
1 parent 5e62964 commit 29204b7
Show file tree
Hide file tree
Showing 39 changed files with 116 additions and 88 deletions.
10 changes: 5 additions & 5 deletions modules/all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</parent>

<name>XSK - Modules - All</name>
<artifactId>xsk-modules-all</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-api-all</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-engines-all</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-all</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
</dependencies>
</project>
6 changes: 3 additions & 3 deletions modules/api/api-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-api-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - API - All</name>
<artifactId>xsk-modules-api-all</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-api-xsjs</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
</dependencies>
</project>
4 changes: 2 additions & 2 deletions modules/api/api-xsjs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-api-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - API - XSJS</name>
<artifactId>xsk-modules-api-xsjs</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

</project>
4 changes: 2 additions & 2 deletions modules/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - API - Parent</name>
<artifactId>xsk-modules-api-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>pom</packaging>

<modules>
Expand Down
6 changes: 3 additions & 3 deletions modules/engines/engine-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-engines-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</parent>

<name>XSK - Modules - Engines - All</name>
<artifactId>xsk-modules-engines-all</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-engines-core</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
</dependencies>
</project>
8 changes: 4 additions & 4 deletions modules/engines/engine-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-engines-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - Engines - Core</name>
<artifactId>xsk-modules-engines-core</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-all</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-api-all</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright (c) 2019-2020 SAP SE or an SAP affiliate company and XSK contributors
* Copyright (c) 2019-2021 SAP SE or an SAP affiliate company and XSK contributors
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, v2.0
* which accompanies this distribution, and is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-FileCopyrightText: 2019-2020 SAP SE or an SAP affiliate company and XSK contributors
* SPDX-FileCopyrightText: 2019-2021 SAP SE or an SAP affiliate company and XSK contributors
* SPDX-License-Identifier: Apache-2.0
*/
package com.sap.xsk.engine;
Expand All @@ -17,6 +17,7 @@

import org.apache.commons.io.IOUtils;
import org.eclipse.dirigible.engine.api.script.IScriptEngineExecutor;
import org.eclipse.dirigible.engine.js.api.IJavascriptModuleSourceProvider;
import org.eclipse.dirigible.engine.js.graalvm.processor.GraalVMJavascriptEngineExecutor;
import org.eclipse.dirigible.repository.api.IRepositoryStructure;
import org.graalvm.polyglot.Context;
Expand Down Expand Up @@ -118,4 +119,9 @@ public String getType() {
public String getName() {
return ENGINE_NAME;
}

@Override
public IJavascriptModuleSourceProvider getSourceProvider() {
return sourceProvider;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Copyright (c) 2019-2020 SAP SE or an SAP affiliate company and XSK contributors
* Copyright (c) 2019-2021 SAP SE or an SAP affiliate company and XSK contributors
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, v2.0
* which accompanies this distribution, and is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-FileCopyrightText: 2019-2020 SAP SE or an SAP affiliate company and XSK contributors
* SPDX-FileCopyrightText: 2019-2021 SAP SE or an SAP affiliate company and XSK contributors
* SPDX-License-Identifier: Apache-2.0
*/
package com.sap.xsk.engine;
Expand All @@ -16,13 +16,15 @@
import java.nio.charset.StandardCharsets;

import org.eclipse.dirigible.engine.api.script.IScriptEngineExecutor;
import org.eclipse.dirigible.engine.js.api.IJavascriptModuleSourceProvider;

/**
* The GraalVM Repository Module Source Provider.
*/
public class XSKRepositoryModuleSourceProvider {
public class XSKRepositoryModuleSourceProvider implements IJavascriptModuleSourceProvider {

private static final String XSJS_EXTENSION = ".xsjs"; //$NON-NLS-1$
private static final String XSJSLIB_EXTENSION = ".xsjslib"; //$NON-NLS-1$
private static final String JS_EXTENSION = ".js"; //$NON-NLS-1$

private IScriptEngineExecutor executor;
Expand Down Expand Up @@ -53,6 +55,7 @@ public XSKRepositoryModuleSourceProvider(IScriptEngineExecutor executor, String
* @throws URISyntaxException
* the URI syntax exception
*/
@Override
public String loadSource(String module) throws IOException, URISyntaxException {

if (module == null) {
Expand All @@ -62,18 +65,37 @@ public String loadSource(String module) throws IOException, URISyntaxException {
byte[] sourceCode = null;
if (module.endsWith(XSJS_EXTENSION)) {
sourceCode = executor.retrieveModule(root, module).getContent();
} else if (module.endsWith(XSJSLIB_EXTENSION)) {
sourceCode = executor.retrieveModule(root, module).getContent();
} else if (module.endsWith(JS_EXTENSION)){
sourceCode = executor.retrieveModule(root, module).getContent();
} else if (module.indexOf(XSJS_EXTENSION + "/") > 0){
module = module.substring(0, module.indexOf(XSJS_EXTENSION + "/") + 5);
sourceCode = executor.retrieveModule(root, module).getContent();
} else if (module.indexOf(XSJSLIB_EXTENSION + "/") > 0){
module = module.substring(0, module.indexOf(XSJSLIB_EXTENSION + "/") + 8);
sourceCode = executor.retrieveModule(root, module).getContent();
} else if (module.indexOf(JS_EXTENSION + "/") > 0){
module = module.substring(0, module.indexOf(XSJS_EXTENSION + "/") + 3);
sourceCode = executor.retrieveModule(root, module).getContent();
} else {
sourceCode = executor.retrieveModule(root, module, XSJS_EXTENSION).getContent();
if (sourceCode == null || sourceCode.length == 0) {
if (executor.existsModule(root, module, XSJS_EXTENSION)) {
sourceCode = executor.retrieveModule(root, module, XSJS_EXTENSION).getContent();
if (sourceCode == null || sourceCode.length == 0) {
sourceCode = executor.retrieveModule(root, module, JS_EXTENSION).getContent();
}
} else if (executor.existsModule(root, module, XSJSLIB_EXTENSION)) {
sourceCode = executor.retrieveModule(root, module, XSJSLIB_EXTENSION).getContent();
if (sourceCode == null || sourceCode.length == 0) {
sourceCode = executor.retrieveModule(root, module, XSJSLIB_EXTENSION).getContent();
}
} else if (executor.existsModule(root, module, JS_EXTENSION)) {
sourceCode = executor.retrieveModule(root, module, JS_EXTENSION).getContent();
if (sourceCode == null || sourceCode.length == 0) {
sourceCode = executor.retrieveModule(root, module, JS_EXTENSION).getContent();
}
} else {
throw new IOException("Module: " + module + " does not exist.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions modules/engines/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - Engines - Parent</name>
<artifactId>xsk-modules-engines-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>pom</packaging>

<modules>
Expand Down
14 changes: 7 additions & 7 deletions modules/parsers/parser-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - Parsers - All</name>
<artifactId>xsk-modules-parsers-all</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-hdbdd</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-xsodata</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-hdbti</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-hdbtable</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-hdbview</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
</dependency>
</dependencies>
</project>
4 changes: 2 additions & 2 deletions modules/parsers/parser-calculationview/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - Parsers - Calculation View</name>
<artifactId>xsk-modules-parsers-calculationview</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions modules/parsers/parser-hdbcalculationview/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - Parsers - HDB Calculation View</name>
<artifactId>xsk-modules-parsers-hdbcalculationview</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-hdbdd-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - Parsers - HDB DD - IDE</name>
<artifactId>xsk-modules-parsers-hdbdd-ide</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<build>
Expand Down
4 changes: 2 additions & 2 deletions modules/parsers/parser-hdbdd/com.sap.xsk.models.hdbdd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<parent>
<groupId>com.sap.xsk</groupId>
<artifactId>xsk-modules-parsers-hdbdd-parent</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>XSK - Modules - Parsers - HDB DD</name>
<artifactId>xsk-modules-parsers-hdbdd</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.0</version>
<packaging>jar</packaging>

<build>
Expand Down
Loading

0 comments on commit 29204b7

Please sign in to comment.