I want to reference a 3th party library:
import com.googlecode.mp4parser.authoring.Movie;
but in android studio, gradle puted the library in C:\Users\flieks\.gradle\...
Now how do i "export" the plugin project?
i want to have mp4parser somewhere in folders src\android\main.java
Greetings
Felix
You can reference a Gradle file in your plugin to allow you to pull in other libraries (if I'm understanding your question correctly). Check out plugin.xml in the crosswalk-webview plugin for an example on how to add one in:
https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview/blob/master/plugin.xml
Once you do that you can import the class in your plugin code.
adding this to the plugin.xml did the trick
<platform name="android">
<config-file parent="/*" target="res/xml/config.xml">
<feature name="Mp4Parser">
<param name="android-package" value="com.catwalk.mp4parser.Mp4Parser" />
</feature>
</config-file>
<config-file parent="/*" target="AndroidManifest.xml" />
<source-file src="src/android/Mp4Parser.java" target-dir="src/com/catwalk/mp4parser/Mp4Parser" />
<framework src="src/android/build.gradle" custom="true" type="gradleReference" />
</platform>
and this in same folder as the JAVA file
dependencies {
compile group: 'com.googlecode.mp4parser', name: 'isoparser', version: '1.1.7'
}
Related
After I created one backoffice extension using "ant extgen with ybackoffice template".
And I want add jrebel to this backoffice extensions but not reloading when i change code.
So, please help me to solve the problem to save time for deployment.Thanks
Check if backoffice extensions packaged as .jar packages contain rebel.xml files and if you make a code change in .java file, new .class files are generated in $PLATFORM_HOME/bin/custom/$EXTENSION_NAME/backoffice/classes directory that is defined in rebel.xml.
copy-paste from documentation portal:
Backoffice extensions that are packaged as JAR files need a descriptor file called rebel.xml. This XML file will tell JRebel that the .class files for this JAR are in that folder. To achieve this, you will need to do the following for all extensions you want reloaded:
To recompile via an IDE, set the compile output to where the classes are actually compiled to with ant build. For backoffice extensions, this would be $PLATFORM_HOME/bin/custom/$EXTENSION_NAME/backoffice/classes.
Create the following rebel.xml in $EXTENSION_NAME/backoffice/resources:
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd">
<classpath>
<!-- Make sure to replace $PLATFORM_HOME and $EXTENSION_NAME with your concrete values -->
<dir name="$PLATFORM_HOME/bin/custom/$EXTENSION_NAME/backoffice/classes"/>
</classpath>
</application>
Edit $EXTENSION_NAME/buildcallbacks.xml and add the following before build callback:
<macrodef name="$EXTENSION_NAME_before_build">
<sequential>
<mkdir dir="${ext.$EXTENSION_NAME.path}/backoffice/classes" />
<copy file="${ext.$EXTENSION_NAME.path}/backoffice/resources/rebel.xml" todir="${ext.$EXTENSION_NAME.path}/backoffice/classes/" failonerror="false" />
</sequential>
</macrodef>
This will make sure that rebel.xml is bundled into the compiled extension JAR file on build.
When changing classes from the IDE, just recompile the class (either with ant build or via the IDE after setting the correct compile output) and reload the browser. The changed .class files are picked up by JRebel and reloaded on the fly.
Let say that I have execute an ionic run android or ionic build android command. And i have an after prepare hook script. I would like to know whether i am building an android or other platform in the after prepare script so that i can perform the correct action in the script. How could it be done?
Something i would expect:
if (ionic.build.platform === 'android')
You could achieve this using separate settings in config.xml for your hook scripts, then either have one hook script per platform, or maybe use parameters passed to your hook script to identify the platform.
For example, you might want to do something like:
<platform name="android">
<hook type="after_prepare" src="scripts/android/after_prepare.sh" />
</platform>
<platform name="ios">
<hook type="after_prepare" src="scripts/ios/after_prepare.sh" />
</platform>
Source: Cordova documentation.
cordova plugin add cordova-plugin-screen-orientation
After I fetched the plugin cordova-plugin-screen-orientation with the line above I looked inside the config.xml and I couldn't find a similar line like below for the plugin.
<gap:plugin name="org.apache.cordova.media-capture" />
I already tried
guessing the plugin id/name (PhoneGap Build kept saying the plugin is unsupported):
<gap:plugin name="org.apache.cordova.screen-orientation" />
<gap:plugin name="cordova-plugin-screen-orientation" />
The last line is the plugin id/name from the plugins plugin.xml.
to find the plugin id/name on the sites below:
build.phonegap.com/plugins
plugins.telerik.com/cordova
cordova.apache.org/plugins
to get help by making an issue at the repository of the plugin (the issue has been deleted so I removed the link to the issue)
searching on stackoverflow and google with:
configure plugin phonegap
adding plugin to phonegap
adding src="npm":
<gap:plugin name="cordova-plugin-screen-orientation" src="npm" />`
Can someone tell me the plugin id/name or how to configure the plugin in the config.xml?
The solution is replacing src="npm" with source="npm".
<gap:plugin name="cordova-plugin-screen-orientation" source="npm" version="1.4.0" />
Credits go to https://github.com/bau720123 for giving me the solution in the issue I created on GitHub. The issue is deleted so I can't post a link to it.
For more info on how to configure a plugin in the config.xml go here:
http://docs.phonegap.com/phonegap-build/configuring/plugins/
I have a library with a pretty verbose configuration section. I've created an XSD and would like to distribute that with my package so that when a user installs the package, Visual Studio knows about the XSD without the user needing to do anything extra. How do I do this?
You can include any files you want in a nuget package by placing them in the content directory. These will then be installed into the root of your target project when the package is installed. If you're using a nuspec file to build your package you would add the following element under the element.
<files>
<file src="Configuration\MyXsd.xsd" target="content\TargetFolderName" />
</files>
This will create the following file in the target project
\TargetFolderName\MyXsd.xsd
Once the xsd is in the target project visual studio should pick it up automatically for validating your config section.
This has recently become more complicated with SDK style projects and the different ways of referencing nuget packages.
Note the end of this section.
Basically, if a nuget project is referenced by package.config file, the files from the content folder of the nuget package will be copied to the referencing project. If the nuget package is referenced by PackageReference in the project file, the files from the contentFiles folder within the package will be used. It is recommended to include both.
Now if you are using a .nuspec file to configure your nuget package, you can use SynXsiS answer to include the file to both directories:
<files>
<file src="Configuration\MyXsd.xsd" target="content\TargetFolderName" />
<file src="Configuration\MyXsd.xsd" target="contentFiles\any\any\TargetFolderName" />
</files>
However, if you want to configure it in the .csproj file of SDK projects, you have to add the file you want to include in the nuget package into the project file with the following properties:
<ItemGroup>
<None Include="MyXsd.xsd">
<Pack>true</Pack>
<PackagePath>contentFiles\any\any\TargetFolderName;content\TargetFolderName</PackagePath>
</None>
</ItemGroup>
The any\any\ part of the path for the contentFiles specifies for which language (cs, vb, ...) and target framework the file is meant.
Note, that the item not necessarily has to be of type "None" it could also be "Content" and others as described here.
You can find all information for this structure here, general information of the folder structure can be found here and help for the SDK style projects here.
I'm not sure if this is possible, but currently I am using a CruiseControl.net build server with a nAnt script to handle all of the building, testing, and packaging. I have nAnt manipulate some files and archive them. Is there a way to display that zip file that the nAnt script generated in the CruiseControl.net Package List? I am using ccnet 1.5 and nAnt 0.91 alpha2.
Thanks.
After much research, I have come to this conclusion:
Packages only show the files related to that build not all.
You can only build these packages within the CCNet.config
If you make a package by hand, it will be corrupted within the build server
It might be possible to create the package and drop the required files in the folder, but you will have to modify a couple of the statistic files and what not, but i gave up and no one has responded to this.
I did this because I was not happy with ccnet's package publisher. First you need to trick ccnet into creating a dummy package; the package will be created in [ArtifactDirectory]\[CCNetLabel]. Then run a nant script which replaces the package and updates the package xml.
ccnet config:
<publishers>
<package>
<name>Build-$[$CCNetLabel]</name>
<compression>0</compression>
<packageList />
</package>
<nant>
<buildArgs>-D:PackageName="Build-$[$CCNetLabel]"</buildArgs>
<buildFile>script.build</buildFile>
<targetList>
<target>PackagePublisher</target>
</targetList>
</nant>
</publishers>
nant:
<target name="PackagePublisher">
<property name="PackageDirectory" value="${CCNetArtifactDirectory}\${CCNetLabel}" />
<property name="PackageFullPath" value="${PackageDirectory}\${PackageName}.zip" />
<delete file="${PackageFullPath}" />
<zip zipfile="${PackageFullPath}">
<fileset>
<!-- include everything you need to package -->
</fileset>
</zip>
<!-- find package.xml; it is the only xml file in the PackageDirectory -->
<foreach item="File" property="PackageXml">
<in>
<items basedir="${PackageDirectory}">
<include>*.xml</include>
</items>
</in>
<do>
<xmlpoke file="${PackageXml}" xpath="//package[#name='${PackageName}']/#size" value="${file::get-length(PackageFullPath)}" />
</do>
</foreach>
</target>
The last part ensures the package size is displayed properly in the PackageList web page.