Skip to content

Commit

Permalink
First working version of merging Flex+Harman through MSDKI on macOS (#32
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rat-moonshine committed Apr 30, 2021
1 parent 1250d26 commit 15d1e80
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 37 deletions.
3 changes: 2 additions & 1 deletion ApacheFlexSDKInstallerLib/src/InstallApacheFlex.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,7 @@ variables are not required because the locations of these pieces are known.
}
}
public function runInstallerScriptHarmanAIR(antPath:File, server:String, fileName:String, suffix:String):void
public function runInstallerScriptHarmanAIR(antPath:File, server:String, fileName:String, suffix:String, flexUnzippedFolderName:String):void
{
ant = new Ant();
ant.output = output;
Expand All @@ -2541,6 +2541,7 @@ variables are not required because the locations of these pieces are known.
context["air.download.server"] = server;
context["air.download.file"] = fileName;
context["air.download.suffix"] = suffix;
context["flex.unzipped.folder"] = flexUnzippedFolderName;
context["verbose"] = true;
if (file.exists && !ant.processXMLFile(file, context, true))
Expand Down
Binary file modified MoonshineSDKInstaller/libs/ApacheFlexSDKInstallerLib.swc
Binary file not shown.
34 changes: 12 additions & 22 deletions MoonshineSDKInstaller/src/components/HelperInstaller.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -249,24 +249,10 @@
return;
}
default:
/*archiveDownloader = new ArchiveDownloader(item);
archiveDownloader = new ArchiveDownloader(item);
archiveDownloader.installerApacheFlexInstance = INSTALLER_APACHE_FLEX;
archiveDownloader.viewResourceConstants = viewResourceConstants;
archiveDownloader.startInstallation();*/
var targetAntFile:File = (new File(itemDownloading.installToPath)).resolvePath("harman-air-installer.xml");
FileUtils.copyFile(
File.applicationDirectory.resolvePath("installer/harman-air-installer.xml"),
targetAntFile,
true
);
INSTALLER_APACHE_FLEX.runInstallerScriptHarmanAIR(
targetAntFile,
HelperConstants.CONFIG_HARMAN_AIR_SERVER,
HelperConstants.CONFIG_HARMAN_AIR_FILE,
"?license=accepted"
);
archiveDownloader.startInstallation();
break;
}
}
Expand Down Expand Up @@ -352,23 +338,27 @@
if (itemDownloading.type == ComponentTypes.TYPE_FLEX_HARMAN)
{
var targetAntFile:File = (new File(itemDownloading.installToPath)).resolvePath("harman-air-installer.xml");
FileUtils.copyFile(
File.applicationDirectory.resolvePath("installer/ant-contrib-0.6.jar"),
(new File(itemDownloading.installToPath)).resolvePath("ant-contrib-0.6.jar"),
true
);
FileUtils.copyFile(
File.applicationDirectory.resolvePath("installer/harman-air-installer.xml"),
targetAntFile,
true
);
var tmpArr:Array = itemDownloading.downloadURL.split("/");
var packageFileName:String = tmpArr[tmpArr.length - 1];
packageFileName = HelperConstants.IS_MACOS ?
packageFileName.replace(".tar.gz", "") :
packageFileName.replace(".zip", "");
INSTALLER_APACHE_FLEX.runInstallerScriptHarmanAIR(
targetAntFile,
HelperConstants.CONFIG_HARMAN_AIR_SERVER,
HelperConstants.CONFIG_HARMAN_AIR_FILE,
"?license=accepted"
"?license=accepted",
packageFileName
);
return;
}
// sometime distributed zip/tar creates an additional
Expand Down
Binary file not shown.
35 changes: 21 additions & 14 deletions MoonshineSDKInstaller/src/installer/harman-air-installer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<property name="air.download.server" value="${AIR.DOWNLOAD.SERVER}"/>
<property name="air.download.file" value="${AIR.DOWNLOAD.FILE}"/>
<property name="air.download.suffix" value="${AIR.DOWNLOAD.SUFFIX}"/>
<property name="flex.unzipped.folder" value="${FLEX.UNZIPPED.FOLDER}"/>
<property name="dest.air.sdk.directory" location="TEMP/AIR"/>

<condition property="isMac" value="mac">
Expand All @@ -56,49 +57,52 @@
</target>

<target name="runWindows" if="isWindows">
<echo>Running Windows target</echo>
<antcall target="dispose-temp-windows" />
</target>

<target name="runMacOS" if="isMac">
<echo>Running Mac target</echo>
<antcall target="dispose-temp-UNIX" />
</target>

<target name="get-air-sdk">
<mkdir dir="${basedir}/${dest.air.sdk.directory}" />
<!--get src="${air.download.server}/${air.download.file}${air.download.suffix}" dest="${basedir}/${dest.air.sdk.directory}"/-->
<copy file="/Users/santanu/Downloads/MoonshineSDKss/Flex_SDK/AIRSDK_MacOS.zip" tofile="${basedir}/${dest.air.sdk.directory}/${air.download.file}" overwrite="true"/>
<echo>Downloading Harman AIR SDK</echo>
<get src="${air.download.server}/${air.download.file}${air.download.suffix}" dest="${basedir}/${dest.air.sdk.directory}"/>
<!--copy file="/Users/santanu/Downloads/MoonshineSDKss/Flex_SDK/AIRSDK_MacOS.zip" tofile="${basedir}/${dest.air.sdk.directory}/${air.download.file}" overwrite="true"/-->
<echo>Copied into: ${basedir}/${dest.air.sdk.directory}/${air.download.file}</echo>
</target>

<target name="unzip-air-sdk">
<echo>Starting UNZIP: ${basedir}/${dest.air.sdk.directory}/${air.download.file}</echo>
<echo>Starting to unzip: ${basedir}/${dest.air.sdk.directory}/${air.download.file}</echo>
<unzip src="${basedir}/${dest.air.sdk.directory}/${air.download.file}" dest="." />
</target>

<target name="untar-air-sdk">
<echo>Starting UNTAR: ${basedir}/${dest.air.sdk.directory}/${air.download.file}</echo>
<echo>Starting to untar: ${basedir}/${dest.air.sdk.directory}/${air.download.file}</echo>
<exec executable="tar" dir="${basedir}">
<arg value="-xvf" />
<arg value="${basedir}/${dest.air.sdk.directory}/${air.download.file}" />
</exec>
<echo>Completed untar Harman AIR SDK</echo>
</target>

<target name="mac-copy-dir" description="copies a directory using exec and rsync so that symbolic links are preserved">
<echo file="${basedir}/maccopy.properties">mac.copy.echo=${mac.copy.echo.pattern}</echo>
<property file="${basedir}/maccopy.properties" />
<delete file="${basedir}/maccopy.properties" />
<echo>${mac.copy.echo}</echo>
<exec executable="rsync" dir="${FLEX_HOME}">
<target name="mac-copy-flex-dir" if="isMac" description="copies a directory using exec and rsync so that symbolic links are preserved">
<echo>Moving files to SDK directory</echo>
<exec executable="rsync" dir="${basedir}">
<arg value="--archive" />
<arg value="--ignore-existing" />
<arg value="--force" />
<arg value="${download.dir}/airsdk/${srcdir}"/>
<arg value="${destdir}" />
<arg value="${basedir}/${flex.unzipped.folder}/."/>
<arg value="${basedir}" />
</exec>
<delete dir="${basedir}/${flex.unzipped.folder}" />
</target>

<target name="fixup-air-config-file">
<replace file="frameworks/air-config.xml">
<echo>Fixing AIR configuration file</echo>
<replace file="${basedir}/frameworks/air-config.xml">
<replacefilter token="{airHome}/frameworks/"
value=""/>
</replace>
Expand All @@ -107,8 +111,11 @@
<!-- Deletes temporary files for Windows -->
<target name="dispose-temp-windows" depends="get-air-sdk,unzip-air-sdk,fixup-air-config-file">
<delete dir="${basedir}/TEMP" />
<echo>Deleted temp files.</echo>
</target>
<target name="dispose-temp-UNIX" depends="get-air-sdk,untar-air-sdk,fixup-air-config-file">
<target name="dispose-temp-UNIX" depends="mac-copy-flex-dir,get-air-sdk,untar-air-sdk,fixup-air-config-file">
<echo>Trying to delete temp files..</echo>
<delete dir="${basedir}/TEMP" />
<echo>Deleted temp files.</echo>
</target>
</project>

0 comments on commit 15d1e80

Please sign in to comment.