New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grunt Build in SAP Web IDE #2312

Open
hschaefer123 opened this Issue Apr 17, 2018 · 11 comments

Comments

Projects
None yet
6 participants
@hschaefer123

hschaefer123 commented Apr 17, 2018

Hi,
thanks for making CachebusterInfo.json available in @sap/grunt-sapui5-bestpractice-build": "1.3.50.

Building outside WebIDE there is currently an issue inside task devx-updateNeoApp!

The path is only correctly resolved on windows and not on Linux!

On windows my neo-app.json
"welcomeFile": "/webapp/index.html",
will be correctly changed to
"welcomeFile": "/index.html",

but this does not work for our CI/DI on Linux!

Maybe inside
var sSourceFolderRelativePath = "/" + grunt.config.data.dir.appFolder;
the appFolder is not relative on Linux and therefore this does not work.

It would be great to get that fixed, because we are developing locally and building/deploying it to MTA using git pipeline.

BTW: Do you have any info how to use the new feature

task for building an HTML5 module inside full-stack projects. The build results are stored as part of the .mtar file.

Please let me know the fixed version number.

Thanks
Holger

@themasch

This comment has been minimized.

themasch commented Apr 17, 2018

I guess this problem resides in getComponentParent / getRootDir / isComponentInCurrentFolder.

getComponentParent already has some special support for absolute paths but does this only for very special cases (webide?).
Whap happens is, that appFolder (which is set to componentParentDir) happes to be something like this on linux: /home/user/code/customer/project/webapp/.
devx-updateNeoApp tries to replace that whole thing in oNeoAppJsonContent.welcomeFile, which does not work since welcomeFile is something like /webapp/index.html.

In previous versions appFolder (was then called webapp) was fixed to /webapp which is why it worked in this case.

I have not found the exact point where the path resolution failes but getComponentParent is where I would start tracing the issue.

@avizov

This comment has been minimized.

avizov commented Apr 18, 2018

Hi Holger,

This is a good point. I have observed more places in the grunt best practices that don't treat correctly the path resolution. We need to use Path.join() instead concatenation. I will open an internal ticket for that and let you know as soon as we release a fixed version.

Thanks,
Alex

@gaiawork

This comment has been minimized.

gaiawork commented May 6, 2018

Hi Holger,

A fix is available with @sap/grunt-sapui5-bestpractice-build version 1.3.55

Regards,
Gaia

@hschaefer123

This comment has been minimized.

hschaefer123 commented May 7, 2018

Hi Gaia,
it is working as expected!

Thank you.

Currently the sap-ui-cachebuster-info.js is not generated if i deploy using SAP Web IDE Full-Stack.
Is SAP aware of this bug?

Regards Holger

@avizov

This comment has been minimized.

avizov commented May 7, 2018

Hi Holger,

What do you mean "deploy using SAP Web IDE Full-Stack"? Do you mean deploy multi-target project (mta) project?

Thanks,
Alex

@hschaefer123

This comment has been minimized.

hschaefer123 commented May 7, 2018

Hi Alex,
if i am building locally, it works for me.

Trying to deploying using the SAP Web IDE Full-Stack means i am using the new SAP Web IDE Full-Stack app inside SAP Cloud Plattform that uses build from grunt.loadNpmTasks("@sap/grunt-sapui5-bestpractice-build");

Since i am using the IDE integrated build process, i know that there is a special switch/case inside the grunt-sapui5-bestpractice-build. Doing it this way, there is no sap-ui-cachebuster-info.js build/deployed to the corresponing html5 app.

Inside the Web IDE Full Stack the formerly integrated build/deploy process have been removed/reworked by using more public node/grunt process (the same way i am using locally), but the generated/handled artifacts in the target html5 container differ from the one generated locally (in this case the missing sap-ui-cachebuster-info.js.

I hope, this is understandable.

Regards Holger

@avizov

This comment has been minimized.

avizov commented May 7, 2018

Hi Holger,

I am not sure if I understood you right. But, I also success to build it locally and it worked for me (the cache buster file successfully created for me). If you do that from the Full Stack Web IDE (the build process) it also builds it correctly but you can't see the sap-ui-cachebuster-info.js file since this is very hidden file and therefore you can't see it in the file structure. The only way to see it is to export the project to your downloads and to open the archive file and then you will see it under the dist folder.

Thanks,
Alex

@hschaefer123

This comment has been minimized.

hschaefer123 commented May 7, 2018

Hi Alex,
first of all thanks for the hint, that even when selecting show hidden fields option in Web IDE, the cachebuster will not be shown (for whatever reason ;-)

If i export the project from web ide, i can see that /dist/sap-ui-cachebuster-info.js is part of the archieve,
but it seems to be missing in the scp deployed version.

An example for the issue is my current youtube control
https://github.com/hschaefer123/youtube

If i deploy this with Web IDE to SCP HTML5
https://youtube-p1940953245trial.dispatcher.hanatrial.ondemand.com/index.html

you will get an 404 eror on
https://youtube-p1940953245trial.dispatcher.hanatrial.ondemand.com/sap-ui-cachebuster-info.json?sap-ui-language=en

So i think, the Web IDE hide feature for special file extensions maybe hide/excludes this file also on deployment?!? ;-) From my point that can be the only reason for this, because build seems ok (even not seeable on IDE) but deployment of this file misses.

Local deployment using
neo-java-web-sdk/tools/neo deploy-mta deploy-mta.properties
is working as expected!

Can you confirm this, or did you get a Web IDE using CacheBuster on SCP running this way?

Regards Holger

@thecodester

This comment has been minimized.

Contributor

thecodester commented Jun 27, 2018

@avizov Can you respond or close this issue? Thanks.

@avizov

This comment has been minimized.

avizov commented Jun 27, 2018

Hi Holger,

We still investigating the issue. By the way, you shared here (https://github.com/hschaefer123/youtube) your project but can you share also your project after it passed the built?

Thanks,
Alex

@avizov

This comment has been minimized.

avizov commented Jun 27, 2018

Hi Holger,
I succeed to reproduce the issue the same as you described. Update you as soon as possible.
Thanks,
Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment