How do I set up Robolectric in IntelliJ? - unit-testing

I know there are instructions here, but they are not clear to me at all. I have an existing project that's built using ANT, so I'm not Mavenized, and I'm not starting from scratch. An awesome tutorial with screenshots would be great, as I'm sure I'm not the only one who has had problems with this.

The only thing you can really do is to look at Pivotal's AndroidIntelliJStarter project, and mimick what they are doing. This is what I had to do to get my project setup.

Related

How to actually use c++ Nana

I am a beginner in c++. I want to use nana for a cross platform GUI in this github project, Flying fur doggys, but I have no experience with cmake. How do I attach nana to my project with cmake, I have tried a few different online resources but they all seem too complicated. If there is any easy way to install it, with clion as well, please let me know.
I have tried copying the source code and using the very little knowledge I have, tried to add the files for my project to the cmake txt. The program isn't working at all.
If there is another project that is better for beginners, that is cross platform. I'd be happy to use it as long as I know how to install it ;)

Testing C++ code: Using test libraries

I've been studying C++ for a while, but this is the first time I'm into a C++ project (a pet configuration parser library). I'm using the Google C++ Testing Framework to test this. But I don't know if I'm doing it right.
Currently, I've ripped off some parts of this Google test library and put it into my projects Test/googletest directory. It works OK, but I wonder if this is how I'm supposed to do this. I'm including the source code of the testing framework in my project and it will be released with my code. This makes me feel uncomfortable.
I wandered through some C++ projects on GitHub, trying to see how other people deal with this. Some have custom framework-lets, and most solve the whole problem with not testing the code at all.
I wonder if I'm taking this right, or otherwise how can I adopt a testing method that will both keep the framework out of my source tree and let me release my code with tests buildable and executable by the user?
Concerning your build, you're doing it right. The gtest readme explicitly states that building gtest (you can pack a libgtest.a from the two object files) along with your project is the prefered way to do it.
Concerning the distribution:
Ideally, you could have your build tool (make, CMake, etc) check out / fetch the required gtest version from its own repository. But I don't think there is much harm if you add an "external" folder to your project and include stuff like gtest in your own repository.

How to use a framework in NetBeans

I'm trying to use a framework in NetBeans (Mac OSX).
The framework is qwt and it resides as qwt.framework in /Library/Frameworks.
To get a project going and using this framework I did two things in project settings:
1) Added a link option '-framework qwt'
2) Added include directory '/Library/Frameworks/qwt.framework/Headers'
This gets thing going, and programmes successfully compile and run, but I'm wondering if this is the correct way to utilise a framework in NetBeans. I guess I was hoping I could just add the framework somewhere, and not have to worry about the includes as they'd be picked up automatically.
Can anyone provide advice on a more efficient/correct way to use a framework in NetBeans?
Thanks
Pete
After doing a bit of google research, it appears there's no simpler way to utilise a framework in NetBeans than do the above steps ie. a) add a link option '-framework xxx' and b) add the include directory from the framework, which resides in xxx.framework/Headers (usually). XCode and QtCreator have options to add a framework directly, but it appears NetBeans doesn't have this option. Hope these steps are useful to someone out there wanting to use NetBeans and frameworks. (I prefer NetBeans over QtCreator to make Qt projects as I find its debugging facilities and general IDE better to use.)
Pete

Resources for setting up a Visual Studio/C++ development environment

I haven't done much "front-end" development in about 15 years since moving to database development. I'm planning to start work on a personal project using C++ and since I already have MSDN I'll probably end up doing it in Visual Studio 2010. I'm thinking about using Subversion as a version control system eventually. Of course, I'd like to get up and running as quickly as I can, but I'd also like to avoid any pitfalls from a poorly organized project environment.
So, my question is, are there any good resources with common best practices for setting up a development environment? I'm thinking along the lines of where to break down a solution into multiple projects if necessary, how to set up a unit testing process, organizing resources, directories, etc.
Are there any great add-ons that I should make sure I have set up from the start?
Most tutorials just have one simple project, type in your code and click on build to see that your new application says, "Hello World!".
This will be a Windows application with several DLLs as well (no web development), so there doesn't need to be a deploy to a web server kind of process.
Mostly I just want to make sure that I don't miss anything big and then have to extensively refactor because of it.
Thanks!
I would also like a good answer to this question. What I've done is set it up so that each solution makes reference to a $(SolutionDir)\build directory for includes and libraries. That way each project that has dependencies on other projects can access them and versions won't compete. Then there are post-build commands to package up headers and .lib files into a "distribution" folder. I use CC.net to build each package on checkin. When we decide to update a dependency project we "release" it to ourselves, which requires manual tagging, manual copying current.zip into a releases area and giving it a version number, and copying that into the /build of the projects that depend on the upgrade.
Everything works pretty great except this manual process at the end. I'd really love to get rid of it but can't seem to. Read an article from ACM about "Continuous Release" that would be really nice to have an implementation of but there isn't any. I keep telling myself I'll make one.
If I use "junctions" in the windows filesystem I can link "distribute" to "build" and then build a secondary solution that includes all the projects that are dependent on each other to build a product. When I did that though it encouraged developers to use it for active development, which discouraged TDD and proper releasing.

keeping Eclipse-generated makefiles in the version control - any issues to expect?

we work under Linux/Eclipse/C++ using Eclipse's "native" C++ projects (.cproject). the system comprises from several C++ projects all kept under svn version control, using integrated subclipse plugin.
we want to have a script that would checkout, compile and package the system, without us needing to drive this process manually from eclipse, as we do now.
I see that there are generated makefile and support files (sources.mk, subdir.mk etc.), scattered around, which are not under version control (probably the subclipse plugin is "clever" enough to exclude them). I guess I can put them under svn and use in the script we need.
however, this feels shaky. have anybody tried it? Are there any issues to expect? Are there recommended ways to achieve what we need?
N.B. I don't believe that an idea of adopting another build system will be accepted nicely, unless it's SUPER-smooth. We are a small company of 4 developers running full-steam ahead, and any additional overhead or learning curve will not appreciated :)
thanks a lot in advance!
I would not recommend putting things that are generated in an external tool into version control. My favorite phrase for this tactic is "version the recipe, not the cake". Instead, you should use a third party tool like your script to manipulate Eclipse appropriately to generate these files from your sources, and then compile them. This avoids the risk of having one of these automatically generated files be out of sync with your root sources.
I'm not sure what your threshold for "super-smooth" is, but you might want to take a look at Maven2, which has a plugin for Eclipse projects to do just this.
I know that this is a big problem (I had exactly the same; in addition: maintaining a build-workspace in svn is a real pain!)
Problems I see:
You will get into problems as soon as somebody adds or changes project settings files but doesn't trigger a new build for all possible platforms! (makefiles aren't updated).
There is no overall make file so you can not easily use the build order of your projects that Eclipse had calculated
BTW: I wrote an Eclipse plugin that builds up a workspace from a given (textual) list of projects and then triggers the build. That's possible but also not an easy task.
Unfortunately I can't post the plugin somewhere because I wrote it for my former employer...