walzer / deprecated-cocos-prd

Drafts of product design. We have already implemented most of them in cocos.
0 stars 1 forks source link

[installer_PRD] IN-0006: Configuring the NDK #2

Open natural-law opened 10 years ago

natural-law commented 10 years ago

I have a question about this requirement:

We don't know whether the developer has installed NDK or not. Because the NDK is always a zip file after downloaded. Developers only unzip it for installing.

ricardoquesada commented 10 years ago

So, if it is not possible to know whether or not a previous NDK is installed, we should always install it... and keep track of which NDK version we installed.

linshun commented 10 years ago

Do you mean that Cocos Creator will bring one NDK inside? It will make Cocos Creator become a fat file, and I am not sure whether we can redistribute it or not. Where do you draw the line?

Is it possible to notice developers "Choose the NDK directory" or "skip" but no install it by default? If they don't have a NDK, they should prepare it outside Cocos Installer.

natural-law commented 10 years ago

As I discussed this requirement with @walzer before. We got this result: We should make developers do choices when they must do it.

For example, if a developer want to develop a game for android. We will let him provide the NDK, SDK and ANT only when he wants to build the project for android. But not any other time before.

On the other hand, if Cocos Creator always install NDK for developers. I think a lot of developers will complain about that : I have a NDK installed myself, why did you install another one for me again?

ricardoquesada commented 10 years ago

Cocos Creator's user are people who want things that work. They don't want to configure things manually, or downloading things manually. They might know nothing about NDKs... they just want to download a product that allows them to create games for iOS and Android.

Some people might have the the NDK already installed, some not. Some people might have and outdated NDK installed, some not. Some people might not know where they have installed the NDK, some not.

If a new NDK is released, and Cocos Creator needs it, then Cocos Creator will have to update it.

So, for me, the easiest way to solve it is by bundling the NDK... just because a lot of our users know nothing about it. If I have to tell the user: You have to download the NDK manually, and then you have to setup these environment variables in order to run your game on Android they will complain a lot.

Remember: Cocos Creator is for more "newbie" users. We are targeting a new segment here. Existing cocos2d-x users can keep using cocos2d-x if they want.

linshun commented 10 years ago

I agree with you that will be more convenient to users if Cocos Creator focus more on "newbie" users. We should assume that users have empty environment that we should prepare everything they need, such as python, ant, SDK, NDK (windows or mac).

It would be a fat fat file.

ricardoquesada commented 10 years ago

Yes, it would be a fat file. I think we should have both an "online" and "offline" installers. The "offline" is the fat file. The "online" is just one small installer that downloads the components online.

Another alternative is to download the "Android" components only then the user wants to deploy for android.

Example:

linshun commented 10 years ago

I prefer Solution 1: "offline" and "online" choice.

minggo commented 10 years ago

But NDK and Android SDK is very big.

natural-law commented 10 years ago

I just found that the requirements of "online installer" is similar with the project "Cocos Installer". The project "Cocos Installer" is cancelled about 8 months ago.

linshun commented 10 years ago

Could you please show us the PRD of the previous version "Cocos Installer"?

linshun commented 10 years ago

I have a question about "online" version: does it always download the right version of NDK, SDK? or it can provide a selection that developers could use it to select a folder from local directory?

natural-law commented 10 years ago

Could you please show us the PRD of the previous version "Cocos Installer"?

Now I only have the repository locally. In the readme of the repo, there are links of issue-system & design document.

But I can't see the remote repo anymore. Also I don't have the permission of the google doc.

The google doc link is : https://drive.google.com/a/cocos2d-x.org/?tab=wo#folders/0B3Jswv2LO-8PNWgwYlNWS1pJeGM

I'm sorry it's in Chinese.

ricardoquesada commented 10 years ago

To be clear, the requirements is:

Regarding iOS:

Regarding Android:

So, the installer must do whatever it is needed (either bundle the NDK/SDK, or download it on demand) in order to have the games running on Android.

natural-law commented 10 years ago

@ricardoquesada , I see. Now there are so many tools we are depending on. The dependences list is:

  1. Android SDK
  2. Android NDK
  3. Apache Ant
  4. Python
  5. JRE/JDK
  6. XCode
  7. Visual Studio

Could you show me which ones will be bundled into our installer? Thanks! Also please tell me how about the other dependences. Thank you very much!

ricardoquesada commented 10 years ago

@natural-law

we support 3 main platforms:

The only that is extremely complex to install and configure is the NDK / SDK.

So, we don't need to bundle Xcode and Visual Studio since telling the user to download them and installing them is super easy. But for Android, that is another story.

As I said before: I don't know if it should be bundled in the installer, or not. But deploying for android should work. What does Unity do ? What does Marmalade do ? What does Xamarin + Mono do ?

Please take a look at other projects. thanks.

ricardoquesada commented 10 years ago

Perhaps it make sense to do something like this: