Skip to content
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

Dev dependencies jars dexed into final apk #323

Closed
blagoev opened this issue Jan 5, 2016 · 6 comments
Closed

Dev dependencies jars dexed into final apk #323

blagoev opened this issue Jan 5, 2016 · 6 comments

Comments

@blagoev
Copy link
Contributor

blagoev commented Jan 5, 2016

This version of sample-Groceries https://github.com/NativeScript/sample-Groceries/tree/166a91cfa3012f61961a8e1b67b47cb3919bba88

have some problems building because we try to dex jscs jars into the apks. jscs is a devDependency and should not be included in the apk at all.

@blagoev blagoev added this to the 1.6.0 (Under review) milestone Jan 5, 2016
@Plamen5kov
Copy link
Contributor

Currently we traverse all folders and include all .jar files that we find. Maybe it's a good idea to include some kind of filter to find out whether these .jar files are a part from a {N} plugin or not.
(suggestion) include a regex that makes sure .jar files are in platforms/android/ folder inside the plugin

Further more we need to completely ignore dev-dependencies when packaging the {N} .apk file.

@Plamen5kov
Copy link
Contributor

the problems:

  • the build should ignore devDependencies, when creating metadata
  • the plugin should ignore every .jar that is not related to native android plugin structure

the second problem is fixed with: #328

possible solution for the first problem is for us to read the package.json at build time and ignore every dev-dependency name we find, because the name of the folder in the node_modules dir is exactly as it is defined in the package.json file.

of cource thats only one possible solution and I am open to suggestions.

@NathanaelA

This comment was marked as abuse.

@Plamen5kov
Copy link
Contributor

I thought about some different scenarios, we may encounter in the future and here they are:

  • normal npm packages (not {N} plugins)
    • installed as dev dependencies (problem if contains jars)
    • installed as normal dependencies (problem if contains jars)
  • {N} npm plugins
  • installed as dev dependencies
  • installed as normal dependencies (no problem)

when we deal with normal npm packages, even they have some .jar files in them we should ignore them and that's done with #328.

we still haven't got a plan how to deal with the {N} plugins that are installed as dev dependencies, but we think it's a good idea for the plugin to "declare" itself as a dev dependant only plugin through it's include.gradle file, and depending on whether or not it want's to include .jar files that will be necessary for it's operation during runtime.

@blagoev
Copy link
Contributor Author

blagoev commented Jan 13, 2016

"to "declare" itself as a dev dependant only plugin"

That's sometimes not dependent on the plugin. I may want to use some plugin as dev dependency. In node actually the user decide not the plugin author.

@Plamen5kov
Copy link
Contributor

well in that case, it's probably best to read the package.json file to find out what plugins did the user add as dev-dependencies, so we can provide metadata for that plugin, if necessary.

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

No branches or pull requests

5 participants