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

Setup & Structure #2

Closed
tmcw opened this issue Feb 17, 2014 · 14 comments
Closed

Setup & Structure #2

tmcw opened this issue Feb 17, 2014 · 14 comments
Assignees

Comments

@tmcw
Copy link
Contributor

tmcw commented Feb 17, 2014

This repo has 3 gradle files: build.gradle, settings.gradle, and MapBoxAndroidDemo/build.gradle

Which of these should I import? What's the story on this directory structure - why isn't MapBoxAndroidDemo the root path?

@tmcw
Copy link
Contributor Author

tmcw commented Feb 17, 2014

Likewise with the readme:

Add MapBox Android SDK as a dependency in your Android project's build.gradle

Which?

@bleege
Copy link
Contributor

bleege commented Feb 17, 2014

The setup that this project uses is the stock IntelliJ Android project layout when one creates a new Android project. What's different about this from the main Mapbox Android SDK project is that it's using Gradle in multi module mode as opposed to single module / project. That's why there's one main build.gradle at the root level and the module's build file at MapBoxAndroidDemo/build.gradle (where the Mapbox SDK dependency is listed). They're all tied together via the settings.gradle.

In theory we could convert the main Mapbox Android SDK project to be multi module too so that we could include demo and testing projects in the same repo. That said it's probably more accessible for devs to have the demo project in a standalone repo.

@tmcw
Copy link
Contributor Author

tmcw commented Feb 17, 2014

What's different about this from the main Mapbox Android SDK project is that it's using Gradle in multi module mode as opposed to single module / project.

Why is that? Should there be other modules in the future? Since there's just one module right now, can we collapse the structure a bit?

@tmcw
Copy link
Contributor Author

tmcw commented Feb 17, 2014

Also: which file do you import?

@bleege
Copy link
Contributor

bleege commented Feb 17, 2014

Both IntelliJ and Android Studio (Google) create new projects in this style, primarily because it's just more future proof / flexible for most developers (i.e., it's easier to add new modules in the future should you choose / need to).

IMHO we definitely should collapse the Mapbox Android SDK project codebase (which is one of the reasons I put it into PR 165). This isolates the SDK into it's own Gradle defined deliverable (.AAR). Another module (in the same repo) could be a test module (which needs to be it's own Android app), which would have the SDK as a dependency. FWIW, I've be looking at Android Unit and Functional testing lately and we're definitely going to need to go down a similar route to make this happen.

@tmcw
Copy link
Contributor Author

tmcw commented Feb 17, 2014

Okay: so for now, what file do you import? Which gradle file?

@bleege
Copy link
Contributor

bleege commented Feb 17, 2014

You'd import the root level build.gradle which should take it's cue from the corresponding settings.gradle file. Just make sure that you've done Step 2 of the instructions (SDK install process) first.

@bleege
Copy link
Contributor

bleege commented Feb 17, 2014

GitHub Comment Tag! Ha! :-)

@bleege
Copy link
Contributor

bleege commented Feb 18, 2014

@tmcw Hope you were able to get things setup and working this afternoon. To help things out a bit I've created a (local for now) branch of the main mapbox:master where I'm splitting things out into this multi-module approach. It'll make things a little more standard / consistent as well as help get us to a place were automated testing is easier and in the same project.. From there you and Francisco can kick the tires to see if this is a direction that you want the project to head in. I'll let you know more when I have something.

@tmcw
Copy link
Contributor Author

tmcw commented Feb 18, 2014

I'm importing ./build.gradle but it isn't finding the successfully built SDK - is there some step to set up a local maven repo or something?

And the imported project has no build configuration:

2014-02-18 at 4 48 pm

@tmcw
Copy link
Contributor Author

tmcw commented Feb 18, 2014

Upon investigation into my maven .m2 directory, maven names things in your local repository according to the directory name of the project when you run the gradle file. So mine was called mb-android-sdk, so it didn't match Mapbox-Android-SDK. My feelings on this are (CENSORED) because it seems like a (CENSORED) mistake mistake mistake.

With that out of the way, we should add that to the README :).

@tmcw tmcw closed this as completed in 8de377b Feb 18, 2014
@bleege
Copy link
Contributor

bleege commented Feb 18, 2014

Bummer. That does sound like a pain in the ass. That said, I'm a bit confused about your findings though as Maven only stores its cached dependencies via the following pattern: groupid:articifactid:verion

Are you saying that the path to the locally installed AAR file was:

/Users/tom/.m2/repository/com/mapbox/mapboxsdk/mb-android-sdk/1.0.0-SNAPSHOT/mb-android-sdk-1.0.0-SNAPSHOT.aar

instead of something like:

/Users/brad/.m2/repository/com/mapbox/mapboxsdk/Mapbox-Android-SDK/1.0.0-SNAPSHOT/Mapbox-Android-SDK-1.0.0-SNAPSHOT.aar

If so then this is an error with the Gradle Android Maven plugin / config in SDK project. Please confirm and I'll investigate.

@tmcw
Copy link
Contributor Author

tmcw commented Feb 18, 2014

Yeah - that's the case, mine was named according to the parent directory. I guess Java takes directory structure Very Seriously

@bleege
Copy link
Contributor

bleege commented Feb 18, 2014

Yeah... Java is VERY picky about names, capitalization, paths, etc when it comes to tracking down resources. It's universally referred to as Classpath Hell in Java circles.

Anyway, thanks for confirming. I'll add this to my TODO list.

@vivek50 vivek50 mentioned this issue Oct 28, 2018
langsmith added a commit that referenced this issue Mar 28, 2019
# This is the 1st commit message:

initial additions

# This is the commit message #2:

Removed errant letters in manifest

# This is the commit message #3:

removed vector images
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

2 participants