Skip to content

Commit

Permalink
build: license headers removed from source, maintained in .reuse/deps…
Browse files Browse the repository at this point in the history
… only
  • Loading branch information
bsrdjan committed Aug 31, 2023
1 parent 5f454ad commit fb3ebab
Show file tree
Hide file tree
Showing 38 changed files with 1,101 additions and 5,224 deletions.
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Disclaimer: The code in this project may include calls to APIs (“API Calls”)
parties the right to use of access any SAP External Product, through API Calls.

# Source code, tests, documentation
Files: abap-api-tools/abap-api/** abap-api-tools/api/** abap-api-tools/config/** abap-api-tools/src/** abap-api-tools/tests/** abap-api-tools/.gitignore abap-api-tools/tsconfig.json assets/** doc/** docker/** model/** *.md abap-value-help/**
Files: abap-api-tools/abap-api/** abap-api-tools/api/** abap-api-tools/config/** abap-api-tools/src/** abap-api-tools/tests/** abap-api-tools/.gitignore abap-api-tools/tsconfig.json assets/** doc/** docker/** *.md abap-value-help/**
Copyright: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
License: Apache-2.0

Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/abap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# default: for parameters and field initializers, tags irrelevant

# Posting period YYYYMM
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/aurelia-abap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# aurelia

# ABAP datatypes mapping to ui elements via key: tag
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/aurelia.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# aurelia

# ABAP data element annotations:
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fast-ngx.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# Microsoft FAST for Angular

# ABAP data element placeholders:
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fast-react-abap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# Microsoft FAST for React

# ABAP datatypes mapping to ui elements via key: tag
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fast-react.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# Microsoft FAST for React

# ABAP data element placeholders:
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fast-vue-abap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# Microsoft FAST for Vue

# ABAP datatypes mapping to ui elements via key: tag
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fast-vue.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# Microsoft FAST for Vue

# ABAP data element placeholders:
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fundamental-ngx-abap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# SAP Fundamental Library for Angular

# ABAP datatypes mapping to ui elements via key: tag
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fundamental-ngx.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# SAP Fundamental Library for Angular

# ABAP data element placeholders:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# SAP Fundamental Library for React

# ABAP datatypes mapping to ui elements via key: tag
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fundamental-react.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# SAP Fundamental Library for React

# ABAP data element placeholders:
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fundamental-vue-abap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# SAP Fundamental Library for Vue

# ABAP datatypes mapping to ui elements via key: tag
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/fundamental-vue.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# SAP Fundamental Library for Vue

# ABAP data element placeholders:
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/ui5-react-abap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# SAP ui5-react

# ABAP datatypes mapping to ui elements via key: tag
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/configuration/ui/ui5-react.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0

# SAP ui5-react

# ABAP data element placeholders:
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/ts/abap.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/usr/bin/env node

// SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
//
// SPDX-License-Identifier: Apache-2.0

import fs from "fs";
import path from "path";
import yargs from "yargs";
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/ts/alpha.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
//
// SPDX-License-Identifier: Apache-2.0

import { RfcStructure } from "node-rfc";

export type AlphaCatalogType = {
Expand Down
4 changes: 0 additions & 4 deletions abap-api-tools/src/ts/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
//
// SPDX-License-Identifier: Apache-2.0

import {
AbapCliResult,
AbapCliUiConfig,
Expand Down
38 changes: 18 additions & 20 deletions abap-api-tools/src/ts/backend.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
//
// SPDX-License-Identifier: Apache-2.0

// check search_help_api

import chalk from "chalk";
import fs from "fs";
import path from "path";
Expand Down Expand Up @@ -108,11 +102,11 @@ type StatCatalogType = Record<
string,
| Record<string, number>
| {
var?: number;
struct?: number;
table?: number;
exception?: number;
}
var?: number;
struct?: number;
table?: number;
exception?: number;
}
>;

type UsageCatalogType = Record<string, string[]>;
Expand Down Expand Up @@ -559,9 +553,11 @@ export class Backend {
}

log.info(
`\n${chalk.bold(this.api_name)} ${this.systemId} (${this.argv.lang}) ${this.argv.textOnly ? "only texts" : ""
} ${this.getSearchHelps ? "value helps" : ""}${this.argv.helps ? " w. descriptors" : ""
}\n`
`\n${chalk.bold(this.api_name)} ${this.systemId} (${this.argv.lang}) ${
this.argv.textOnly ? "only texts" : ""
} ${this.getSearchHelps ? "value helps" : ""}${
this.argv.helps ? " w. descriptors" : ""
}\n`
.replace(/ +/g, " ")
.replace(/^ +/g, "")
);
Expand Down Expand Up @@ -656,10 +652,10 @@ export class Backend {
return (
(a.FUNCNAME as string).localeCompare(b.FUNCNAME as string) ||
PClass.indexOf(a.PARAMCLASS as string) -
PClass.indexOf(b.PARAMCLASS as string) ||
PClass.indexOf(b.PARAMCLASS as string) ||
(a.OPTIONAL as string).localeCompare(b.OPTIONAL as string) ||
PType.indexOf(a.paramType as string) -
PType.indexOf(b.paramType as string) ||
PType.indexOf(b.paramType as string) ||
(a.paramName as string).localeCompare(b.paramName as string)
);
});
Expand Down Expand Up @@ -781,15 +777,16 @@ export class Backend {
log.info(
sprintf(
"%-15s",
`${ParamClassDesc[p.PARAMCLASS as string].toLowerCase()} ${p.paramType === ParamClass.table ? "" : p.paramType // table table -> table
`${ParamClassDesc[p.PARAMCLASS as string].toLowerCase()} ${
p.paramType === ParamClass.table ? "" : p.paramType // table table -> table
}`
),
sprintf(`%-${param_name_len}s`, p.paramName),
(p.nativeKey ? chalk.red : chalk)(
// native ABAP datatype printed in red
p.nativeKey
? "Native ABAP datatype. no annotations " + p.PARAMTEXT ||
`No text in language: ${this.argv.lang}`
`No text in language: ${this.argv.lang}`
: p.PARAMTEXT || `No text in language: ${this.argv.lang}`
)
);
Expand Down Expand Up @@ -833,8 +830,9 @@ export class Backend {
const folder_yaml: string = path.join(folder_root, "yaml");
log.info(
(textOnly ? "\nAnnotations' texts" : "\nAnnotations") +
` saved to: ${runningInDocker ? folder_yaml.replace(DockerVolume, "") : folder_yaml
}`
` saved to: ${
runningInDocker ? folder_yaml.replace(DockerVolume, "") : folder_yaml
}`
);
try {
const total = {
Expand Down
14 changes: 8 additions & 6 deletions abap-api-tools/src/ts/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
//
// SPDX-License-Identifier: Apache-2.0

import fs from "fs";
import path from "path";

Expand Down Expand Up @@ -88,15 +84,21 @@ export const Languages = Object.freeze({
export const DefaultLanguage = "en";

// Parameter types
export const ParamType: Record<"var" | "struct" | "table" | "exception", string> = Object.freeze({
export const ParamType: Record<
"var" | "struct" | "table" | "exception",
string
> = Object.freeze({
var: "var",
struct: "struct",
table: "table",
exception: "exception",
});

// Parameter classes
export const ParamClass: Record<"import" | "changing" | "table" | "export" | "exception", string> = Object.freeze({
export const ParamClass: Record<
"import" | "changing" | "table" | "export" | "exception",
string
> = Object.freeze({
import: "I",
changing: "C",
table: "T",
Expand Down
41 changes: 21 additions & 20 deletions abap-api-tools/src/ts/frontend.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
//
// SPDX-License-Identifier: Apache-2.0

import chalk from "chalk";
import path from "path";
import { sprintf } from "sprintf-js";
Expand Down Expand Up @@ -327,11 +323,13 @@ export class Frontend {
parse(): FrontendResultType {
if (this.flowEcho)
log.info(
`\nfrontend: ${this.argv.ui || ""} using ${this.configPath.abapLocal ? this.configPath.abap : "default abap.yaml"
}${this.argv.ui
? " and " +
(this.configPath.uiLocal ? this.configPath.ui : "default ui.yaml")
: ""
`\nfrontend: ${this.argv.ui || ""} using ${
this.configPath.abapLocal ? this.configPath.abap : "default abap.yaml"
}${
this.argv.ui
? " and " +
(this.configPath.uiLocal ? this.configPath.ui : "default ui.yaml")
: ""
}; field names sorted: ${this.argv["sort-fields"] ? "yes" : "no"}\n`
);

Expand Down Expand Up @@ -378,12 +376,13 @@ export class Frontend {
});

jsWriter.write(
`//\n// ${rfm_name} ${isEmpty(this.abap.stat)
? ""
: JSON.stringify(this.abap.stat[rfm_name])
.replace(/"|{|}/g, "")
.replace(/,/g, " ")
.replace(/:/g, ": ")
`//\n// ${rfm_name} ${
isEmpty(this.abap.stat)
? ""
: JSON.stringify(this.abap.stat[rfm_name])
.replace(/"|{|}/g, "")
.replace(/,/g, " ")
.replace(/:/g, ": ")
}\n//\n// ${Signature}\n//\n`
);
jsWriter.write("// prettier-ignore");
Expand Down Expand Up @@ -504,7 +503,8 @@ export class Frontend {

if (htmlWriter instanceof Writer) {
htmlWriter.write(
`<!-- Parameter: ${param_name} structure: ${Param.TABNAME} ${Param.FIELDNAME || ""
`<!-- Parameter: ${param_name} structure: ${Param.TABNAME} ${
Param.FIELDNAME || ""
} ${Param.PARAMTEXT} -->`
);
}
Expand Down Expand Up @@ -766,9 +766,9 @@ export class Frontend {

const shlp = m.shlp
? JSON.stringify(m.shlp)
.replace(/"type":/, "type: ")
.replace(/,"id":/, ", id: ")
.replace(/"/g, "'")
.replace(/"type":/, "type: ")
.replace(/,"id":/, ", id: ")
.replace(/"/g, "'")
: "";

const abap = JSON.stringify(m.abap)
Expand Down Expand Up @@ -866,7 +866,8 @@ export class Frontend {
result.abap.unit = "!notfound";
if (Param.functionName === "valueHelp") {
log.error(
`${Field.format.DATATYPE} unit not found for ${field_name ? field_name : Param.FIELDNAME
`${Field.format.DATATYPE} unit not found for ${
field_name ? field_name : Param.FIELDNAME
}`
);
} else {
Expand Down
6 changes: 1 addition & 5 deletions abap-api-tools/src/ts/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
//
// SPDX-License-Identifier: Apache-2.0

import fs from "fs";
import yaml from "js-yaml";
import loglevel from "loglevel";
Expand Down Expand Up @@ -77,7 +73,7 @@ export function rmDir(dir: string): void {
log.debug(`rmdir ${dir}`);
} catch (ex) {
//
log.error('Directory could not be removed', dir);
log.error("Directory could not be removed", dir);
}
}

Expand Down
Loading

0 comments on commit fb3ebab

Please sign in to comment.