Simple tool to import sapui5 debug version files
SAPUI5 provides two type of source code:
- The minimized such as Button-dbg.js, which is used for run time
- The debug version such as Button-dbg.js, which contain the human being readable source code.
If we want to study the source code, we only need to add the debug version to the project. But as there are so many source code, it is very difficult to just add the debug version. In order to solve this problem, I create a simple tool for it.
( Under Linux, it is very easy, just use the find command can find out all the *dbg.js and copy it to another folder. As most of us work on Windows, so it come out this blog 😛 )
In the windows command window, go to the directory contain the sapui5 source code, and type command
dir *dbg.js /s /w
The output like
Volume in drive C is OSDisk Volume Serial Number is 0460-99E1 Directory of C:\tool\latest-ui5\20140227\sapui5-dist-static\resources jquery-1.7.1-dbg.js jquery-sap-dbg.js jquery-ui-core-dbg.js jquery-ui-datepicker-dbg.js jquery-ui-position-dbg.js jquery.sap.act-dbg.js ..... 29 File(s) 8,697,392 bytes Directory of C:\tool\latest-ui5\20140227\sapui5-dist-static\resources\sap\ca\scfld\md ApplicationFacade-dbg.js ComponentBase-dbg.js ConfigurationBase-dbg.js library-all-dbg.js library-dbg.js Startup-dbg.js 6 File(s) 178,864 bytes
The output will list the directory, then list all the files under that directory. So we can create a tool which will analyze the output, then generate the command which can copy the debug version file into another folder. Then we can import all the files under that folder.
Tool link and usage
Just open Copy UI5 Source
It looks like following, and is very easy to use.
Generated 1.18.6 version copy command file
See attachment. Please remember change the first line to fit your real location
set parent=C:\tool\latest-ui5\1.18.6\sapui5-dist-static\resources copy "%parent%\\jquery-1.7.1-dbg.js" copy "%parent%\\jquery-sap-dbg.js" copy "%parent%\\jquery-ui-core-dbg.js" ..... mkdir sap\ca\scfld\md copy "%parent%\sap\ca\scfld\md\ApplicationFacade-dbg.js" sap\ca\scfld\md copy "%parent%\sap\ca\scfld\md\ComponentBase-dbg.js" sap\ca\scfld\md copy "%parent%\sap\ca\scfld\md\ConfigurationBase-dbg.js" sap\ca\scfld\md copy "%parent%\sap\ca\scfld\md\library-all-dbg.js" sap\ca\scfld\md