Flash builder doesn't create swf file in custom output folder - eclipse

I am trying to build my flex project to a custom output folder.
I am running Flash Builder on windows and I have set the output folder to a custom location.
When I build the project, the SWF file in not generated in the output folder. Instead, I get the folders of my package (e.g. my.package.name generates folder structure my/package/name) and the SWF file in generated in the inner directory.
I know this shouldn't be happening (FB should be generating a SWF file directly under the custom output folder) but can't figure out why it's not working.

Please check in your source code. I think you are using my.package.name in ActionScript class or in <fx:Script> tag. Therefore compiled output is creating directory according to package name.

Related

NetBeans Include External JAR in Export to Zip

I have a NetBeans project that uses the GSON library. I've tried including the GSON.jar file without requiring future users to separately download it. However it doesn't seem to work. The project looks for the file from the relative path of my computer so the file isn't found on another user's computer. Is there a way to include GSON.jar and "Export to Zip" and keep the reference in the project itself? I'm lost!
Thank you
Exporting a Project to ZIP zips up the project folder only, and not anything outside of the folder, including dependencies. If you include the GSON.jar file in the project folder, then the JAR file will be included in the .ZIP file. It's a good practice anyway since NetBeans will use a relative classpath and thus if you move the project itself NetBeans won't give you an error message when loading the project.

Creating a NuGet package for UWP library containing custom Templated Control

I have a UWP class library for Windows 10 which contains a custom templated control, VisualControl. The default template is defined in the Themes\Generic.xaml file.
Here is the directory structure I have created for the NuGet package which targets x86, x64 and ARM.
When I creat a NuGet package with these files, add it to my test application and add the VisualControl to the XAML file, the default theme is not applied to the VisualControl.
Am I packaging the file in an incorrect way? How do I ensure that the default template defined in the Generic.xaml file is picked up and applied to the Control.
Also, are the following files required in the NuGet package? If yes, where should they be placed?
Generic.xbf
TestVisualControl.pri
TestVisualControl.xr.xml
Found out the solution.
The Generic.xbf file should be placed in the Themes folder along with Generic.xaml.
The TestVisualControl.xr.xml file should be placed in a folder named TestVisualControl. This folder should be placed inside uap10.0 folder of each platform.
The TestVisualControl.pri should be placed inside the uap10.0 folder of each platform.
Here is what the final folder structure should look like
Creating a NuGet package with this folder structure would ensure that the style defined in the Generic.xaml file is loaded.

How exlude properties when building executable jar in Eclipse?

This question has been covered here before, but the only solutions I could find were in relation to a project using Ant or Maven. I am using neither. Here is the situation:
I have some application parameters in a properties file. This file is located in my Eclipse project (but in the src folder) and used when I run the application from Eclipse. In addition, I would like the application to also run as an executable jar file, in which case the user can provide the name of a properties file to use in a command line parameters.
The problem now is that the properties file from the project is always packaged into the executable jar and therefore the user is not able to easily modify the properties (yes, I know that (s)he could unzip the jar, but I want to avoid the extra steps).
How can I prevent the properties from being packages into the executable jar file?
Cheers,
Martin
Create a executable jar without properties file in it. Place both jar and properties file in a folder. Now add little code in your main program which should look for a properties file in the same folder and get the complete path of it. And then you can do something like this
System.getProperties().load(new FileInputStream(completepath));
So now your properties will be loaded into system properties with out affecting the actual system properties. You can access your properties by System.getProperty("Propertyname");
Hope this helps. Let me know if you have more questions.

how to use .swc file in flex project

I have a flex project in which I need to as3xls library (.swc file) in my project. Now I have downloaded that swc file and included it in flex-sdk\frameworks\libs and I am able to use the .as files of that swc file.
Now If I have tried to put the swc file in my local project, for e.g. in one of my package of components and added it to the class path (using eclipse project properties -> flex build path) and tried to use it from that location but I am unable to compile the project as its not able to import the .as files.
Can anybody suggest the location where I should add the .swc file and use it in my project ?
If you're using Flash Builder, I generally create a libs folder under the project:
Then, reference the SWC by selecting the project Properties, ActionScript Build Path where you can either add an individual SWC or SWC Folder:
Check out my blog post on How to use a SWC.
Here is the important points:
There are three different ways that you can use the classes that
reside in a SWC file:
* Library Path in Project Properties: This is how
I use SWCs most commonly.
* Libs folder: The libs folder was introduced
in Flex Builder 3. If you put a SWC into a libs folder it is
automatically added to your library path, and all the classes in the
SWC are available from your project
* Library Path command line
argument: You can use the library path argument to the mxmlc command
line compiler.

XML parsing in scala

I am parsing XML file in scala using
val data = XML.loadFile("changes.xml")
I have the changes.xml under the src folder. When I run this the code throws a FileNotFoundException. Any idea how to solve it or any insight on how scala looks for the
files in the classpath would be helpful.
See what the current directory is using
new java.io.File(".").getCanonicalPath()
Since you're opening the file with a relative path, it looks for the file in the process's working directory.
Since you're placing your file in the source tree, I assume you want to ship it with the application jar.
Then tell your IDE to copy the file to the ouput folder (maybe this is already happening) so it lies in the classpath. If you place your file in the same folder as the class from which you want to load you can simply do the following. Use in Java/Scala
Class.getResourceAsStream("changes.xml")
Link to API doc.
Edit
You can use XML.load("changes.xml") and I think it will load the file in the same way as Class.getRessourceAsStream. So try putting your xml file into the same folder as the class and make sure the build process copies it into your binary output folder.