This is a migrated thread and some comments may be shown as answers.

NativeScript, file size, and source control

4 Answers 162 Views
NativeScript Insiders
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
TJ
Top achievements
Rank 1
TJ asked on 22 Dec 2014, 07:23 PM
Hey all,

I've been playing with a NativeScript CLI project and decided I wanted to put it into source control. I naively added all files, and attempted to push and I got the error below:

$ git push origin master
Counting objects: 521, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (468/468), done.
Writing objects: 100% (521/521), 103.11 MiB | 2.46 MiB/s, done.
Total 521 (delta 99), reused 0 (delta 0)
remote: warning: File platforms/ios/build/device/grocery-list.app.dSYM/Contents/Resources/DWARF/grocery-list is 50.59 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: 6f7f6c31f845a8e22d2205209c8e794c
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File platforms/ios/NativeScript.framework/NativeScript is 288.12 MB; this exceeds GitHub's file size limit of 100 MB
To git@github.com:tjvantoll/grocery-list.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:tjvantoll/grocery-list.git'

Basically GitHub says there are some huge files in the project and won't let me push. The weird thing is I can't find the files that git refers to as being too big.

For now I'm excluding the platforms folder via .gitignore, which works, but I'm guessing this isn't something we want to recommend, as you could have platform-specific changes in that folder (aka changes that `tns platform add android/ios` won't add back). Correct me if I'm wrong.

So what I'm wondering is 1) has anyone ran into this GitHub problem? and 2) do we have a recommended .gitignore to exclude the output of builds from source control?

Thanks,
TJ

4 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 25 Dec 2014, 11:39 AM
Hi TJ,

We will require some additional time in order to answer your inquiry, due to holiday vacations. We will get back to you in this thread, as soon as possible. Thank you for the understanding in advance.

Have a nice holidays!

Regards,
Kaloyan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Erjan Gavalji
Telerik team
answered on 05 Jan 2015, 01:58 PM
Hi TJ,

Great input indeed!

While this is on the table, we still haven't created specific instructions as to how to work with NativeScript CLI and source control.

Basically, for the long term, what you did is correct: the `platforms` folder must always be generate-able - its platform-specific files get retrieved from the `tns-ios`/`tns-android` packages in NPMjs.org and its NS-application specific files (tns_modules and the user code) get generated from the content in the main folder.

If the user wants to have anything that is platform-specific, they would:
1) create an *.android.js/*.ios.js file if they have platform-specific JavaScript code
2) create a custom module with its corresponding native binaries under the `modules` folder. 

The implementation/specification of custom modules is still in progress, hence this is not an official information yet.

Kind regards,
Erjan Gavalji
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
TJ
Top achievements
Rank 1
answered on 05 Jan 2015, 04:17 PM
Hey Erjan,

Ok that makes sense. Just fyi I got the sense that the `platforms` folder was editable from this portion of the CLI README (https://github.com/NativeScript/nativescript-cli#create-project), specifically:

> In the platforms directory, you can safely modify configuration files such asAndroidManifest.xml and Info.plist.

Because the docs say you can change those files I just assumed you'd want them stored in source control. If `platforms` is intended to be generated only I think the docs should change to reflect that.

Thanks,
TJ
0
Erjan Gavalji
Telerik team
answered on 06 Jan 2015, 09:19 AM
Indeed!

Thanks for pointing this out!

Putting a second thought, making the `platforms` folder generate-able might be a task too error-prone in the long run. What I mean is that it would require that the NativeScript project structure supports platform-specific file maintenance (like the below-mentioned AndroidManifest and Info.plist files).

That said, it might be better to have that folder included to source control, but instead, each platform-specific project might have its .gitignore. Thus, we would concentrate and specify what we change. Of course, this adds another burden - we're getting locked into git and customers might use svn, TFS, or whatever other source control system. I'm putting these notes to the team discussion list.

Best,
Erjan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
NativeScript Insiders
Asked by
TJ
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Erjan Gavalji
Telerik team
TJ
Top achievements
Rank 1
Share this question
or