Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: test

on:
pull_request:

permissions:
contents: read
pull-requests: write

jobs:
unit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm install
- run: npm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
output
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore-scripts=true
19 changes: 19 additions & 0 deletions abap_transpile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"input_folder": "src",
"input_filter": [],
"libs": [{
"url": "https://github.com/open-abap/open-abap-core"
}],
"output_folder": "output",
"write_unit_tests": true,
"write_source_map": true,
"options": {
"ignoreSyntaxCheck": false,
"addFilenames": true,
"addCommonJS": true,
"setup": {
"filename": "../setup.mjs",
"preFunction": "setup"
}
}
}
6 changes: 1 addition & 5 deletions abaplint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,7 @@
"skipNames": []
},
"unused_methods": true,
"unused_types": {
"exclude": [],
"severity": "Error",
"skipNames": []
},
"unused_types": false,
"unused_variables": {
"exclude": [],
"severity": "Error",
Expand Down
88 changes: 88 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "open-abap-xco",
"version": "1.0.0",
"description": "XCO",
"main": "index.js",
"scripts": {
"lint": "abaplint",
"unit": "rm -rf output && abap_transpile && echo RUNNING && node --expose-gc output/index.mjs && echo OK",
"flame": "0x -o -- node --expose-gc test/performance.mjs",
"performance": "rm -rf output && abap_transpile ./abap_transpile_test.json && node --expose-gc test/performance.mjs",
"integration": "rm -rf output && abap_transpile ./abap_transpile_test.json && node --expose-gc output/index.mjs",
"postgres:init": "cat test/adbc/init.sql | docker exec -i postgresql psql -U postgres -d postgres",
"docker:start": "docker compose -p open-abap -f test/stack.yml up -d --wait && npm run postgres:init",
"test": "npm run lint && npm run unit"
},
"repository": {
"type": "git",
"url": "git+https://github.com/open-abap/open-abap-xco.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/open-abap/open-abap-xco/issues"
},
"homepage": "https://github.com/open-abap/open-abap-xco#readme",
"dependencies": {
"@abaplint/cli": "^2.113.222",
"@abaplint/runtime": "^2.12.2",
"@abaplint/database-sqlite": "^2.11.78",
"@abaplint/transpiler-cli": "^2.12.2"
}
}
8 changes: 8 additions & 0 deletions setup.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {SQLiteDatabaseClient} from "@abaplint/database-sqlite";

export async function setup(abap, schemas, insert) {
abap.context.databaseConnections["DEFAULT"] = new SQLiteDatabaseClient();
await abap.context.databaseConnections["DEFAULT"].connect();
await abap.context.databaseConnections["DEFAULT"].execute(schemas.sqlite);
await abap.context.databaseConnections["DEFAULT"].execute(insert);
}
10 changes: 10 additions & 0 deletions src/if_xco_cp_software_component_f.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
INTERFACE if_xco_cp_software_component_f PUBLIC.

METHODS
for_name
IMPORTING
iv_name TYPE if_xco_software_component=>tv_name
RETURNING
VALUE(ro_software_component) TYPE REF TO if_xco_software_component.

ENDINTERFACE.
15 changes: 15 additions & 0 deletions src/if_xco_cp_software_component_f.intf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_INTF" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOINTERF>
<CLSNAME>IF_XCO_CP_SOFTWARE_COMPONENT_F</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>IF_XCO_CP_SOFTWARE_COMPONENT_F</DESCRIPT>
<EXPOSURE>2</EXPOSURE>
<STATE>1</STATE>
<UNICODE>X</UNICODE>
</VSEOINTERF>
</asx:values>
</asx:abap>
</abapGit>
5 changes: 5 additions & 0 deletions src/if_xco_software_component.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
INTERFACE if_xco_software_component PUBLIC.

TYPES tv_name TYPE c LENGTH 30.

ENDINTERFACE.
15 changes: 15 additions & 0 deletions src/if_xco_software_component.intf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_INTF" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOINTERF>
<CLSNAME>IF_XCO_SOFTWARE_COMPONENT</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>IF_XCO_SOFTWARE_COMPONENT</DESCRIPT>
<EXPOSURE>2</EXPOSURE>
<STATE>1</STATE>
<UNICODE>X</UNICODE>
</VSEOINTERF>
</asx:values>
</asx:abap>
</abapGit>
13 changes: 13 additions & 0 deletions src/xco_cp_system.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CLASS xco_cp_system DEFINITION PUBLIC.
PUBLIC SECTION.
CLASS-DATA software_component TYPE REF TO if_xco_cp_software_component_f READ-ONLY.

CLASS-METHODS class_constructor.
ENDCLASS.

CLASS xco_cp_system IMPLEMENTATION.
METHOD class_constructor.
CREATE OBJECT software_component TYPE lcl_software_component.
ENDMETHOD.

ENDCLASS.
15 changes: 15 additions & 0 deletions src/xco_cp_system.clas.locals.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CLASS lcl_software_component DEFINITION.
PUBLIC SECTION.
INTERFACES if_xco_cp_software_component_f.
INTERFACES if_xco_software_component.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

CLASS lcl_software_component IMPLEMENTATION.

METHOD if_xco_cp_software_component_f~for_name.
CREATE OBJECT ro_software_component TYPE lcl_software_component.
ENDMETHOD.

ENDCLASS.
16 changes: 16 additions & 0 deletions src/xco_cp_system.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>XCO_CP_SYSTEM</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>XCO_CP_SYSTEM</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>