How to install plugins conditionally based on platform using gulp? - gulp

I want to install a plugin only for android and not for ios platform. I want to do it using gulp, so I have created a gulp task for it and used platformify().filter(["android"]). Following is my code snippet but it doesn't work for me.Plugin gets added to both platforms. Not sure I have implemented it right. So any help will be appreciated.
gulp.task('InstallImageResizerPlugin',function(){
platformify().filter(["android"],sh.exec('cordova plugin add https://github.com/wymsee/cordova-imageResizer', {async: true}, function(code, output){}));

Related

PhpStorm: set a specific library version as a project library

I am trying to make JQuery 1.8.3 and JQuery UI 1.9.2 project libraries in PhpStorm 2017. When I go to Settings >> Languages & Frameworks >> Javascript >> Libraries, there is a dropdown near the top with two options:
TypeScript community stubs: here I find simple listings for jquery and jqueryui with no version information.
Official Libraries: here I find listings for jQuery 2.0.0 and jQuery UI 1.10.2
What's the recommended way to get IDE support for the specific versions of these libraries that I intend to use on my project?
Update
I have downloaded the uncompressed jQuery 1.8.3 file and saved it on disk. Then from Settings >> Languages & Frameworks >> JavaScript >> Libraries I selected Add... to link to that custom file and the jQuery documentation.
With #LazyOne's help, I was even able to download what are hopefully the right docs from api.jquery.com. However, the results are mixed:
From good...
To poor...
To non-existent...
To errors...
I'm having the same results and this looks like a bug. I've tried the same project in 2016.3.3 and it showed me correct documentation while in 2017.2.3 IDE displays 2 identical links that do not work. You might want to report this at http://youtrack.jetbrains.com/issues/WEB#newissue=yes. This is also looks like a https://youtrack.jetbrains.com/issue/IDEA-77527 regression

Sharing components across multiple Aurelia projects

we started our project with ES6 javascript skeleton.
we would like to extract some styles and custom attributes to a common folder so we can use these at any Aurelia module we will build in the future.
the problem is with the bundle files. we don't know how to config them to bundle external folder out of the main ES6 folder.
can you please tell us what to do?
It sounds like you want to build an Aurelia plugin that you can import into any project. I would start by taking a look at the Aurelia plugin skeleton.
Once you've built your plugin with the custom styles and attributes you want, you'll want to either register it with jspm as a link, or publically through a registry such as npm or github.
Once published, you will be able to jspm install registry:my-package in any new project, and add the following line to your main.js file:
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.plugin('my-package');
}
For more information on this last step, see the brilliant answer provided by Ashley Grant here.

phpstorm unresolved function or method $()

I have the following problem: phpstorm do not recognize jquery methods and here and there I see
Unresolved function or method $()
This was bugging me for sometime but finally I tried to get rid of it with File->Settings->JavaScript->Libraries and adding jquery as a global / project.
My library setup looks like this:
But is has not changed anything. I still see those pesky notices. Does anyone know how to get rid of them?
There is a really stupid workaround,
Download the Library (in this case jQuery) from inside the IDE itself.
Open up settings (Ctrl + Alt + S on Linux)
Navigate to Languages & Frameworks -> Javascript -> Libraries
Click Download and choose jQuery
Hopefully the errors will vanish
EDIT:
After running the IDE through Fiddler, I realised this only solves the problem because of the version the IDE downloads.
So, the correct workaround is to Add older, non-AMD jQuery versions as a Global scoped Library and add the latest one as a Project scope library.
The latest non-AMD versions are:
1.10.2 for 1.x series. And, 2.0.0 for 2.x series.
I had the same issue with version 1.11.2, and resolved it simply by adding the uncompressed version into my js folder.
Just copy the uncompressed version of jQuery into your project folder.
you don't even need to import it into your project, just copy it to javascript folder.
The jQuery v1.11.0 shows exactly the same behaviour here as well. At the same time previous version 1.10.2 works fine in IDE (no warnings).
I think it has something to do with "AMD-fy jQuery source" ticket (http://bugs.jquery.com/ticket/14113) -- looks like IDE has some issues figuring out this style.
If you wish (and can) -- roll back to jQuery v1.10.2 (which is like half a year old, which means it's stable and still good to use).
Hopefully IDE will be able to properly parse this new jQuery style in next release.
Actual ticket: http://youtrack.jetbrains.com/issue/WEB-10908
If you import both 1.11.0 and 1.10.2 in phpstorm it will be resolved
You don't have to rollback your project.

DriveQuickstart sample project in Android Studio

Can you please provide some guide how to create DriveQuickstart demo application (https://developers.google.com/drive/quickstart-android, steps 2-3) in Android Studio?
The problem is that Android Studio can't find com.google.api.* classes, like com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential. And I can't find it neither in google-play-services.jar, not in Android SDK folders.
I use "Compile with: Google APIs 17" in Android Studio, I downloaded all the latest updates in SDK manager (including Google APIs for API17, Google Play services, Google Repository).
According to http://developer.android.com/google/play-services/setup.html I added
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:4.1.+'
}
in build.gradle. What other actions should I perform to compile the sample source code, add some external library? You have provided great detailed steps for Eclipse, but said nothing about Android Studio with Gradle.
Try adding this to project build.gradel,worked for me in android studio 0.4.3,
sync and then optimize imports(Ctrl+Alt+O) in windows.
compile 'com.android.support:appcompat-v7:19.0.1'
compile 'com.google.android.gms:play-services:4.1.32'
compile('com.google.api-client:google-api-client-xml:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.http-client:google-http-client-gson:1.17.0-rc'
compile('com.google.api-client:google-api-client-android:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.apis:google-api-services-drive:v2-rev105-1.17.0-rc'
Credits go to user #smokybob
In the Quickstart, did you follow all of the items in Step 2?
Specifically it looks like you missed out the last two (confusingly numbered 1 & 2 which install the Google Client Libs into your project. Open the "libs" folder in your project and check that you have a bunch of client libs such as "googleapi-client.jar".

Using Compass in PHPStorm 7

So i'm using brand new PHPStorm 7, which is supposed to have full Compass support, with syntax highlighting and stuff.
I successfully install compass to my project directory, PHPStorm offers me to use compass sass watcher, automatically finds compass.bat and my config.rb .
And then, nothing happens - my #import "compass" still triggers unable to resolve import from watcher, i don't get any code completion or search features. The only solution i know was an old trick of adding compass stylesheets directory as a resource root to my project.
So what i'm asking - is this the way it's supposed to be, or am i doing anything wrong, because i don't think manually importing a library into every project is a proper way for supposed library support.
After all, there is an issue on Windows.
There's the solution, and it works. Thanks LazyOne.
http://youtrack.jetbrains.com/issue/WEB-9139