Using Gradle with R project - r

I am beginning work on a project that makes heavy use of R. I've used R in the past, but only in a casual mode, whereas I'm now interested in following a more rigid practice of test/source control/continuous integration. I'm hoping to use Gradle with this project if possible, but I can't find any evidence that it is possible to use Gradle with R. Is it possible to create an R project with Gradle, and if so, where can I find steps to help me get started?

There appears to be a third-party plugin (https://github.com/jamiefolson/gradle-plugin-r). Alternatively, if R provides some command-line tools or Ant tasks, you can call into them from Gradle.

We have been working on gradle-R-plugin. (link to source is here https://github.com/arekbee/gradle-R-plugin). We have used it for CI/CD with TeamCity. gradle-R-plugin is base on devtools R package. I am happy to help you with this plugin.

Related

Stuck with creating Keyword library using Java in Eclipse and using that JAR file in RIDE

I'm new to ROBOT framework and must create library keyword using java and utilize the JAR files in RIDE editor. I have followed the below steps. But still have confusions in where to start up. Please help me to achieve this.
Steps:
1) Installed Python, wxPython, pybot, RIDE, selenium2library successfully and I'm able to work with RIDE using predefined keywords.
2) For creating own java library, Installed Eclipse Mars, Java, ROBOT IDE manually using the link https://github.com/NitorCreations/RobotFramework-EclipseIDE/wiki/Installation
The question here is,
Anything i'm missing to install?
How to proceed further with Robot Framework coding?
Note: I'm reading many materials in parts to proceed things. But that is confusing me what are the steps to be followed. Is there any single material that i can get having the sequences of steps that need to be followed for my requirements?
The below links I referred with,
https://github.com/NitorCreations/RobotFramework-EclipseIDE/wiki/Usage
Maven error "Failure to transfer..."
Create a Maven project in Eclipse complains "Could not resolve archetype"
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#using-set-test-suite-global-variable-keywords
Let's start with the basics. RIDE is an editor for Robot Script files. Robot Script files are executed by the Robot Framework robot application. It is important to understand the difference between these two applications. One creates files and the other uses them.
Assuming for a moment here that you have some custom functionality in a Jar file that you would like to make available inside the Robot Script files test cases. If this is indeed the case then your focus should be on create Robot Test Libraries. In the documentation there are numerous java examples given for basing your own library on.
This means that you do not need Maven, unless you want to, to create your library. Also Eclipse IDE is not needed nor is RIDE. The library you create can be used by Robot Framework even when it's run from the command line. Feel free to use them for what they are good at: writing Robot Scripts efficiently and running Robot through menu options instead of command line windows.
When you are familiar with Eclipse and comfortable with it's features, then I can also recommend using the Eclipse Application RED which is a mature Eclipse add on for creating, running and debugging Robot scripts.
There are two ways of implementing a Java routine in Robot Framework and it depends a bit on how you run Robot Framework: Python or Jython. Running Python means that you need to run the Java in a separate JVM container and connect to it. The simplest way is via Command Line interaction. This may cause some security concerns. The second approach is to use the Remote Library approach. A good example of this is the Robot Framework Sikuli Library. An added bonus is that you can run Robot and your Java application on two separate machines/servers.
The Jython way has been discussed on StackOverflow before and I gladly refer to it. Please bear in mind that although the examples refer to RIDE, the Library org.company.Keywordlibrary works in all IDE's, provided robot framework is run using Jython.
In the Jython documentation it clearly explains how to setup an Eclipse based IDE with Jython. Do keep in mind that it's recommended to use the same interpreter in development and production. I.e. if you create your scripts in Jython, do run them in 'production' also using Jython. Otherwise you open yourself up to interpreter differences where functionality does not work or behaves differently then expected.
An alternative approach with Jython is the all-in-one Robot Framework Maven JAR plugin. Adding a custom Java Library in this setup is not too difficult. A nice short tutorial can be found on the blog of Valerio Bruno. If this is your preferred route for development, then you may want to read the RED howto on integrating the Robot Framework Maven jar.
Working on your custom functionality is likely going to be a independent project in Eclipse, but can be linked to an Robot project via the Class Path settings in red.xml if you use RED or the CLASS_PATH environment variable.
Done! I have installed RED and required add on using following below steps. It worked successfully with predefined keywords. Now I'm gonna create user defined keywords/libraries using the same editor. I don't know where to start up. Will it work creating just a java project? Should I need to include any additional libraries?
Steps followed to proceed with RED:
1. RED Version Conclusion: https://github.com/nokia/RED/blob/master/release.md
2. RED Installation Instructions: https://github.com/nokia/RED/blob/master/installation.md
3. ROBOT Framework prerequisites using RED: https://github.com/nokia/RED/blob/master/red_help/first_steps/download_install.html.md
4. To verify Installations in Eclipse: Help -> Installation Details to check if RED is visible on installed features list
5. Create Project and Tests using RED in Eclipse: https://github.com/nokia/RED/blob/master/red_help/first_steps/create_run.html.md
6. RED Steps: https://github.com/nokia/RED/blob/master/First_steps.md
7. Quick STart: https://github.com/nokia/RED/blob/master/red_help/user_guide/quick_start.html.md

Testing Meteor packages with Velocity?

Velocity is an amazing testing framework for Meteor and I am currently using it to test my application code.
Now I added a local package to the app, but I don't know how (or if) I can test the package with Velocity, too. I would like to drop tinyTest in favor for a consistent testing framework - Velocity.
Is it possible to test packages with Velocity? How should the file structure look like?
Yes, it is possible to test packages with sanjo:jasmine. It works in nearly the same way as with TinyTest. You can find all information to get started in the sanjo:jasmine README. There is also an example package. To run the tests, use the commands from the README.
If you need additional information, let me know.

Is it necessary to use gradle with roboelectric for android unit testing?

I and my team have built up an android library project. it is built up on eclipse but we are using ant to build it. Presently we aren't using gradle. I have a roboelectric with dependencies jar file instead. But when I use this, while running the unit tests, the following error comes up
WARNING: multiple versions of ant detected in path for junit
[junit] jar:file:/Users/prateekarora/Desktop/eclipse/plugins/org.apache.ant_1.9.2.v201404171502/lib/ant.jar!/org/apache/tools/ant/Project.class
[junit] and jar:file:/Users/prateekarora/trunk/client/android/MCCMobileClient/test2/libs/robolectric-2.3-with-dependencies.jar!/org/apache/tools/ant/Project.class
When I remove the apache ant from eclipse's plugin folder, this stops working.
Can Anybody explain why this is happening?
Also, is it necessary to use roboelectric with gradle? If no, where can I find the roboelectric's jar files with/without dependencies?
It is not necessary to use gradle with robolectric. It is just about running specified java class (from junit) with proper classpath (including you source, test code and dependencies). Fixing your case is not something that is easy to make over stackoverflow (it will be some challenge even if you sit behind same computer).
Here are possible solutions:
Migrate your project build to the gradle
Keep using ant but move from dependency management from manuals jars to ivy
Keep using ant and manual jars dependency, but try to get robolectric.jar with all dependencies except ant one
The first one option is the easiest option as for me. It will require to change mindset a bit but this is officially only one supported build tool by Google as well there are a lot of examples and people that could help.
The second one also require you to learn how to use new tool. As well there less examples about ivy usage especially in android projects.
The third one will require to write custom script that removes ant from jar file or to rebuild robolectric-all.jar without one (ant) dependency. This will require to dive into maven build tool learning

Using Maven for R projects

I am beginning work on a project that makes heavy use of R. I've used R in the past, but only in a casual mode, whereas I'm now interested in following a more rigid practice of test/source control/continuous integration. I'm hoping to use Maven with this project if possible (having been pleased with how this manages packages with Java), but I can't find any evidence that it is possible to use Maven with R. Is it possible to create an R project with Maven, and if so, where can I find steps to help me get started?
I've found this question and this question, but they don't mention R.
Well you could make use of the Maven Exec Plugin with the resource, filter and jar plugins to fake an R project type.
You can do something like this to set up multiple R goals with the exec plugin so that compile, filter, test, et al have some kind of R call associated.
http://maven.apache.org/plugins/maven-resources-plugin/

Best build system for embedded development/cross-compiling

I'm doing some development right now using dsPICs and I'm not exactly in love with MPLAB. I'm actually using Visual Studio with a makefile project. Currently I'm using SCons, which seems to work fairly well, after finding a helpful guide to setting up to use an alternate compiler. Still, I can't help but wonder, is there a better build system for this? And also, is there a better way to make Scons do this?
Just use vim, makefiles and call the MPLAB command line compiler yourself.
There are quite a few build systems that you can use:
Buildroot http://www.buildroot.net/
Buildroot-ng http://wiki.openwrt.org/
crosstool-NG http://www.crosstool-ng.org/
PTXdist http://www.ptxdist.org/
OpenEmbedded http://www.openembedded.org/
OE-lite http://oe-lite.org/
muddle https://code.google.com/p/muddle/
Poky http://pokylinux.org/
OpenBricks http://www.openbricks.org/
Yocto Project http://www.yoctoproject.org/
Scratchbox http://www.scratchbox.org/
Cross Linux From Scratch http://www.cross-lfs.org/
Aboriginal Linux http://landley.net/aboriginal/
The very simplest way to do embedded development is to use your favourite code editor for writing the code, then switch to the compiler's IDE to build and download the code to the processor.
Obviously, the code editor and the compiler IDE may be the same thing, which is even simpler!

Resources