Skip to content

Commit

Permalink
Update file utils to order files before directories, resolves issue w…
Browse files Browse the repository at this point in the history
…ith manifest merging overrides not working correctly
  • Loading branch information
marchbold committed Mar 15, 2022
1 parent a4aeaa4 commit cfaf41d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
15 changes: 11 additions & 4 deletions client/apm.iml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="Flex" version="4">
<component name="FlexBuildConfigurationManager" active="apm">
<component name="FlexBuildConfigurationManager" active="apm-cli">
<configurations>
<configuration name="apm" target-platform="Desktop" pure-as="true" main-class="APMConsoleApp" output-file="apm.swf" output-folder="$MODULE_DIR$/out">
<configuration name="apm-cli" target-platform="Desktop" pure-as="true" main-class="APMConsoleApp" output-file="apm.swf" output-folder="$MODULE_DIR$/out">
<dependencies target-player="32.0">
<entries>
<entry library-id="bbc1d467-3c84-470d-8330-75d7c327a77a">
Expand All @@ -12,9 +12,15 @@
<sdk name="current" />
</dependencies>
<compiler-options>
<option name="additionalOptions" value="-compiler.define+=CONFIG::DEBUG,true -compiler.define+=CONFIG::VERSION,'dev'" />
<option name="resourceFilesMode" value="None" />
<option name="additionalOptions" value="-compiler.define+=CONFIG::DEBUG,true -compiler.define+=CONFIG::VERSION,'0.0.1-dev'" />
</compiler-options>
<packaging-air-desktop use-generated-descriptor="false" custom-descriptor-path="$MODULE_DIR$/src/apm.xml" package-file-name="apm" />
<packaging-air-desktop use-generated-descriptor="false" custom-descriptor-path="$MODULE_DIR$/src/apm.xml" package-file-name="apm-cli">
<files-to-package>
<FilePathAndPathInPackage file-path="$MODULE_DIR$/src/apm.bat" path-in-package="apm.bat" />
<FilePathAndPathInPackage file-path="$MODULE_DIR$/src/apm.sh" path-in-package="apm.sh" />
</files-to-package>
</packaging-air-desktop>
<packaging-android />
<packaging-ios />
</configuration>
Expand All @@ -25,6 +31,7 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
</content>
<orderEntry type="jdk" jdkName="current" jdkType="Flex SDK Type (new)" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
13 changes: 10 additions & 3 deletions client/src/com/apm/utils/FileUtils.as
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ package com.apm.utils

/**
* Finds all files in a directory and subdirectores with the specified name
* - lists the files before the directories.
*
* @param filename The file name to search for
* @param directory The base directory to search
* @return An Array of File objects
Expand All @@ -88,19 +90,24 @@ package com.apm.utils
var files:Array = [];
if (directory != null && directory.exists)
{
var subdirectories:Array = [];
for each (var f:File in directory.getDirectoryListing())
{
if (f.isDirectory)
{
files = files.concat(
getFilesByName( filename, f )
);
subdirectories.push( f );
}
else if (f.name == filename)
{
files.push( f );
}
}
for each (var dir:File in subdirectories)
{
files = files.concat(
getFilesByName( filename, f )
);
}
}
return files;
}
Expand Down
4 changes: 2 additions & 2 deletions version.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri, 17 Dec 2021 22:29:16 +1000
#Tue, 15 Mar 2022 18:14:23 +1000

version_major=1
version_minor=1
version_build=3
version_build=4
version_preview=

0 comments on commit cfaf41d

Please sign in to comment.