@@ -19,7 +19,7 @@ function addConfiguration(name, proxyConfig) {
19
19
proxyConfigurations [ name ] = proxyConfig ;
20
20
}
21
21
22
- async function getConfigurationForProject ( project ) {
22
+ async function getConfigurationForProject ( tree ) {
23
23
const configNames = Object . keys ( proxyConfigurations ) ;
24
24
if ( configNames . length === 0 ) {
25
25
throw new Error ( `No proxy configurations have been added yet` ) ;
@@ -29,7 +29,7 @@ async function getConfigurationForProject(project) {
29
29
`This is not yet supported.` ) ; // TODO
30
30
}
31
31
32
- log . verbose ( `Applying proxy configuration ${ configNames [ 0 ] } to project ${ project . metadata . name } ...` ) ;
32
+ log . verbose ( `Applying proxy configuration ${ configNames [ 0 ] } to project ${ tree . metadata . name } ...` ) ;
33
33
const config = JSON . parse ( JSON . stringify ( proxyConfigurations [ configNames [ 0 ] ] ) ) ;
34
34
config . rewriteRootPaths = { } ;
35
35
@@ -40,32 +40,32 @@ async function getConfigurationForProject(project) {
40
40
} ;
41
41
}
42
42
43
- mapProjectDependencies ( project , ( proj ) => {
44
- if ( proj . specVersion !== "1.1a" ) {
45
- log . warn ( `Project ${ project . metadata . name } defines specification version ${ proj . specVersion } . ` +
43
+ mapProjectDependencies ( tree , ( project ) => {
44
+ if ( project . specVersion !== "1.1a" ) {
45
+ log . warn ( `Project ${ project . metadata . name } defines specification version ${ project . specVersion } . ` +
46
46
`Some proxy configuration features require projects to define specification version 1.1a` ) ;
47
47
}
48
- log . verbose ( `Using ABAP URI ${ proj . metadata . abapUri } from metadata of project ${ proj . metadata . name } ` ) ;
48
+ log . verbose ( `Using ABAP URI ${ project . metadata . abapUri } from metadata of project ${ project . metadata . name } ` ) ;
49
49
let prefix = "" ;
50
- if ( proj . type !== "application" ) {
51
- if ( project . resources . pathMappings [ "/resources" ] ) {
50
+ if ( project . type !== "application" ) {
51
+ if ( project . resources . pathMappings [ "/resources/ " ] ) {
52
52
// If the project defines a /resources path mapping,
53
53
// we expect this to match the ABAP URI deployment path
54
54
prefix += "/resources/" ;
55
55
56
56
// If this is not an application and there is no /resources path mapping, somebody does something wild
57
57
// and hopefully knows what he/she does
58
58
}
59
- prefix += proj . metadata . namespace ;
59
+ prefix += project . metadata . namespace ;
60
60
}
61
- config . rewriteRootPaths [ proj . metadata . abapUri ] = {
61
+ config . rewriteRootPaths [ project . metadata . abapUri ] = {
62
62
rewriteTo : prefix
63
63
} ;
64
64
} ) ;
65
65
66
66
if ( log . isLevelEnabled ( "verbose" ) ) {
67
- log . verbose ( `Configured ${ config . rewriteRootPaths . length } root paths to rewrite for ` +
68
- `project ${ project . metadata . name } ;` ) ;
67
+ log . verbose ( `Configured ${ Object . keys ( config . rewriteRootPaths ) . length } root paths to rewrite for ` +
68
+ `project ${ tree . metadata . name } ;` ) ;
69
69
for ( const abapUri in config . rewriteRootPaths ) {
70
70
if ( config . rewriteRootPaths . hasOwnProperty ( abapUri ) ) {
71
71
if ( config . rewriteRootPaths [ abapUri ] . rewriteTo ) {
0 commit comments