When i set the output folder in FDT, this is always REALTIVE to the project folder, even if it has a forward slash...
ex: /Users/paolo/deploy will create the folder in /User/paolo/my_project/Users/paolo/deploy
first.... WHY?????
second: is there a way to set this folder as ABSOLUTE?
many thanx
The reason is to enable multiple developers to develop on the same project. The path is saved in the project. If you share the project via CVS/SVN other developers would need to have the same path. Absolute paths are a bad idea when developing in a team.
I don't know if there is a way to force an absolute path, but I doubt it.
Edit:
I remember there was the possibility to attach an ant script to an run configuration to be executed each time the project is build. You might be able to write the ant script such that it copies the output files to an absolute directory.
In your launch configuration there is a tab for Ant tasks. Add a post-compile ant script, here's an example:
<project name="copy files">
<property name="from" value="../bin"/>
<property name="to" value="/Users/username/deploy>
<target name="Copy All">
<copy todir="${to}" >
<fileset dir="${from}">
<exclude name="Test.swf"/>
</fileset>
</copy>
</target>
</project>
Related
in VS 2012 with Update 2 i have a web site which i publish. the new publish wizard was configured to publish the site to a folder on my disk. while checking something on my temp files folder i ran a publish of my site. i saw that the publisher creates a folder on %TEMP%\WebSitePublish and in there creates 3 copies of the site:
r:\temp\WebSitePublish\web-1279598559\obj\Debug\AspnetCompileMerge\Source\
r:\temp\WebSitePublish\web-1279598559\obj\Debug\AspnetCompileMerge\TempBuildDir\
r:\temp\WebSitePublish\web-1279598559\obj\Debug\Package\
since my web site is huge (1.6GB) each of these folders take 1.6GB and 4.8 GB in total.
while i think this is wasting disk space even during a publish, i can't argue with MS about the way they implemented the publish. the only thing that does bother me is that even after closing the VS IDE, the r:\temp\WebSitePublish\web-1279598559 folder remains and still occupies 4.8GB. How can i make the publisher delete it's temp files after it finishes the publish?
my pubxml for this site is this:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>x86</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\PrecompiledWeb\Site</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<PrecompileBeforePublish>True</PrecompileBeforePublish>
<EnableUpdateable>True</EnableUpdateable>
<DebugSymbols>True</DebugSymbols>
<WDPMergeOption>CreateSeparateAssembly</WDPMergeOption>
<UseFixedNames>True</UseFixedNames>
</PropertyGroup>
</Project>
I think you can set up a 'build target' in your .csproj file (maybe in the .pubxml file instead?), like Why does MSBuild ignore my BeforePublish target? or How can I prevent hidden .svn folder from being copied from the _bin_deployableAssemblies folder?. #sayed-ibrahim-hashimi has a lot of answers regarding build targets.
In my experience it's been tricky to figure out what target to attach to, since there has been some churn between different Visual Studio releases, but I think you want something like:
<!-- these are your instructions; name is arbitrary, `AfterTargets` says when -->
<Target Name="CleanTempDirectory" AfterTargets="AfterPublish">
<!-- use 'importance=high' to show in the Output window (?) -->
<Message Text="Cleaning up publish temp directories" Importance="high" />
<!-- here, specify the directory(ies) to clear; can use build event macros -->
<CreateItem Include="$(ProjectDir)App_Data\*\*">
<Output ItemName="GeneratedFiles" TaskParameter="Include" />
</CreateItem>
<Delete Files="#(GeneratedFiles)" />
</Target>
The important parts here are:
AfterTargets -- specifies when this task should be run (and AfterPublish should be self-explanatory; I think that's the right one)
CreateItem -- scan the given directory glob and set a list to the variable #(GeneratedFiles)
Delete -- delete the list created by CreateItem
Our Flash web-based applications play lots of audio for narration and sound-effects. Some of our customers have firewall rules that block downloading of MP3 and other audio files. So, we need to wrap those MP3 files in SWFs. In the past, I've written JSFL scripts that automate the Flash IDE and walk through a complicated, fragile set of steps to embed MP3 files into FLAs and then publish those to SWFs. Now, Flex SDK provides the mxmlc compiler. I've mixed ANT into our workflow, and command-line and automated builds have been a joy. So, I want to make transcoding or wrapping of MP3s part of our build process. I've found Embedding Asset at Compile time in Pure AS3, but this will require that I write a script to generate a wrapper class AS file. Is there a cleaner way to wrap or transcode MP3 files into SWFs? I suppose I'm hoping there is a method for passing the mp3 directly to mxmlc and outputting a swf, but any recommendation better than generating actionscript wrapper classes would be greatly appreciated.
Since you are using MXMLC and Ant already, you should consider adding another bit of code to your Ant build script to build your MP3s into a library SWC. You can then build that SWC into the executable SWF (I've left that simple step out of my example below).
Since all you'll need is Ant, doing it this way is no more difficult than how you're already building your SWF. The only real "gotcha" is that you need to embed your files using an MXMLC/SWC-friendly absolute path (e.g. "/myAssets/myasset.mp3") in your code.
Because it has access to Project metadata, Flash Builder "knows" where the root of your project is, allowing it to use relative embed paths. MXMLC doesn't have any of this info. You therefore need to make sure that the embeds are declared to match the absolute location of how the files are stored in the SWC. If you do this, both Flash Builder and MXMLC/Ant will be able to understand your embeds. That way, everybody's happy.
To help you along, below is an example Ant script for building an asset SWC. Here are the key steps, in a nutshell:
Build up a String containing the locations of the files to be included, one by one
Compile those assets into a SWC using MXMLC and a monster-sized set of command-line arguments
The following script will package jpgs, pngs, svgs, ttfs, xml files, properties files and MP3s into a file called "assets.swc". You'll need to include flexTasks.jar (for obvious reasons) and ant-contrib.jar in the appropriate relative locations and set a FLEX_HOME environment variable.
<?xml version="1.0" encoding="utf-8"?>
<project name="My App Builder"
basedir="."
default="buildSWC"
xmlns:antcontrib="antlib:net.sf.antcontrib">
<taskdef resource="flexTasks.tasks" classpath="${basedir}/libs/flexTasks.jar"/>
<taskdef resource="net/sf/antcontrib/antlib.xml" classpath="${basedir}/libs/ant-contrib-1.0b3.jar"/>
<property environment="env"/>
<property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
<property name="ASSETS_FILE" value="assets.swc"/>
<property name="SRC_DIR" value="./src"/>
<!-- Prepare folders for SWC compilation -->
<target name="buildSWC">
<echo message=""/>
<echo message="*****************************************************"/>
<echo message="* ${ASSETS_FILE}"/>
<echo message="*****************************************************"/>
<echo message="...basedir: ${basedir}"/>
<!-- Build a swc from statically-included assets (images, mp3s, xml files, properties files) -->
<fileset id="assets.flex" dir="src" includes="**/*.jpg,**/*.png,**/*.mp3,**/*.css,**/*.svg,**/*.swf,**/*.TTF,**/*.jpeg,**/*.xml,**/*.properties"/>
<pathconvert pathsep=" " property="assets.flex.output" refid="assets.flex" dirsep="/">
<map from="${basedir}/src/" to=""/>
</pathconvert>
<echo message="...Resources being considered..."/>
<var name="filelist" value=""/>
<var name="prefixfilelist" value="-include-file"/>
<for list="${assets.flex.output}" delimiter=" " param="asset">
<sequential>
<echo>Asset: #{asset}</echo>
<propertyregex property="prop"
input="${asset}"
regexp="(.*)${SRC_DIR}/(.*)"
select="\2"
casesensitive="false"
defaultvalue="./src/"/>
<echo>Prop: ${prop}</echo>
<var name="filelist_tmp" value="${filelist}"/>
<var name="filelist" unset="true"/>
<var name="filelist"
value="${filelist_tmp} ${prefixfilelist} ./#{asset} ${prop}#{asset}"/>
<var name="prop" unset="true"/>
</sequential>
</for>
<echo message="-output ${ASSETS_FILE} ${filelist}"/>
<!-- Windows Compile -->
<exec executable="${FLEX_HOME}/bin/compc.exe"
failonerror="true"
osfamily="winnt">
<arg line="-output ./libs/assets.swc ${filelist}"/>
</exec>
<!-- Unix/Linux Compile -->
<exec executable="${FLEX_HOME}/bin/compc"
failonerror="true"
osfamily="unix">
<arg line="-output ./libs/assets.swc ${filelist}"/>
</exec>
</target>
</project>
We use this approach (which I pieced together from bits and pieces I found on the internet -- I'd gladly give credit if I remembered where) to build a large, module-based project and its embedded images and fonts. There is no reason to think that it wouldn't work for audio files.
Good luck,
Taylor
P.S. There might be some leftover/useless lines of code in there. Also, I'm not an Ant expert, so to any "Ant guys" out there: take it easy on me if I broke any best practices ;)
I've created an AIR application, but it uses an external SWF for extra functionality. I want that SWF to be included in the install, but currently it's not. Is there anyway I can get FlexBuilder or any other tool to include this extra file in the installer? I've tried manually adding the file (as a .air file is just a zip file in disguise), but there must be hash checks inside the file.
If you place the SWF file in your application's src directory it will give you the option to include in the installer (previously I tried putting it in the application's root folder).
If you are working in Flash, go to File>Adobe AIR 2.0 Settings. At the bottom of the dialgoue box is a list of included files. Add your SWF to that list.
What if you wanted to add a text file instead to the installer using Flex Builder? I tried to add it using the export release build wizard, but I don't see the text file generated in the application directory...any ideas?
I would add a custom builder, under project -> properties -> builders
I use something like the following for one of my projects that I want to package some mxml and as files with so that the compiler doesn't try to compile them on export. Save the xml below as something like copy_files.xml and add a new Ant Builder to your project. Under the targets tab of the builder I have mine set to run the copy-files target on every clean.
<?xml version="1.0" encoding="UTF-8"?>
<project name="SampleProject">
<target name="copy-files" description="Copy Source Files">
<copy todir="bin-debug/sources">
<fileset dir="sources" >
<include name="**/*.*" />
</fileset>
</copy>
<copy todir="bin-release/sources">
<fileset dir="sources" >
<include name="**/*.*" />
</fileset>
</copy>
</target>
</project>
I am using Flex and I am tired of having to manually place files in the right folders whenever I want to do a publish. I'd like to do a publish when the build suceeds.
Is there a quick way, using Nant (not my current build tool of choice), to automate this? I have a virtual directory on my PC which is my hosting directory.
Thanks
NAnt has a copy task that will let you do this. Just specify the files and folders you want to copy and the target folder.
If you also build your Flex app with NAnt, you could automatically do the build and the file/folder copy.
An example:
<copy todir="${build.dir}">
<fileset basedir="bin">
<include name="*.dll" />
</fileset>
</copy>
http://nant.sourceforge.net/release/latest/help/tasks/copy.html
I have a project which is source controlled using Subversion and VisualSVN. Since the version of web.config is different on the server and the developers' computers I want the file to remain on the computers but to be ignored by Subversion. I added it to the svn:ignore but it still remains (and still has a red exclamation mark too since we are not committing it).
How can I remove it from Subversion safely without it being deleted from the files system
Thanks,
Adin
you'll have to do both the remove and ignore operation
first make a backup of your local file (like #ibz said)
then remove the web.config from the repository.
then copy back the web.config to the same folder
finally use svn:ignore so that subversion does not try to add it again to the repository
since i use tortoisesvn i can't really tell you what svn commands you have to use, but using tortoisesvn it would be:
make backup
right click on web.config on the folder under source control, select TortoiseSVN | Delete
right click on web.config on the folder under source control, select SVN Commit => after this you will notice that the file is actually deleted from the file system
move up and right click on the folder under source control, select TortoiseSVN | Properties
on the properties window click new + property name "svn:ignore"; property value "web.config". accept changes
commit changes
on my .net projects i include the following exclusion with svn:ignore: bin, obj, *.suo, *.user
Ideally, you should maintain versions of server's copy of web.config in SVN too. We usually rename the production web.config to web.config.prod (a copy for each of the environments) and have the build tool pick the right file and rename it back to web.config while packaging for deployment.
svn rm --force web.config
svn commit
Be careful to back up your local copy (of web.config) before doing this, since it will be deleted.
I have solved this issue using nant with ccnet. Following nant build script replaces web.test.config file with local web.config file;
<?xml version="1.0"?>
<project name="Project1" default="build">
<target name="init" depends="clean" />
<target name="clean" />
<target name="checkout"/>
<target name="compile"/>
<target name="deploy"/>
<target name="test"/>
<target name="inspect"/>
<target name="build" depends="init, checkout">
<call target="compile" />
<call target="inspect" />
<call target="test" />
<call target="deploy" />
</target>
<copy file="..\TestDeployments\Project1\Project1.Solution\Project1.Web.UI\web.Test.config"
tofile="..\TestDeployments\Project1\Project1.Solution\Project1.Web.UI\web.config"
overwrite="true"
/>
<delete file="..\TestDeployments\Project1\Project1.Solution\Project1.Web.UI\web.Test.config" />
</project>
NAnt Copy Task