4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ANEを作るシェルスクリプトのメモ

Posted at
generate.sh
# !/bin/bash

ANE_NAME=<ANEの名前>
BUILD_DIR=<作ったANEを吐き出すディレクトリ>
IOS_BUILD_DIR=<iOS用の.aファイルを置いてあるディレクトリ>
JAR_BUILD_DIR=<Android用の.jarファイルを置いてあるディレクトリ>
DEFAULT_BUILD_DIR=<PC用のlibrary.swfが置いてあるディレクトリ>
USING_DIR=<作ったANEを使う時に置くディレクトリ>

NATIVEEXTENSION_SWC=swc/bin/"$ANE_NAME".swc
IOS_LIB_FILE="$IOS_BUILD_DIR"/lib"$ANE_NAME".a
IOS_PLATFORM="$IOS_BUILD_DIR"/platformoptions.xml
JAR_LIB_FILE="$JAR_BUILD_DIR"/"$ANE_NAME".jar

echo "$IOS_LIB_FILE"
echo "$JAR_LIB_FILE"

mkdir -p -v "$BUILD_DIR"/default
mkdir -p -v "$BUILD_DIR"/ios
mkdir -p -v "$BUILD_DIR"/android

mkdir -p -v "$BUILD_DIR"/swcContents
/usr/bin/unzip -o "$NATIVEEXTENSION_SWC" -d "$BUILD_DIR"/swcContents
cp -f "$BUILD_DIR"/swcContents/library.swf "$BUILD_DIR"
rm -rf "$BUILD_DIR"/swcContents

mkdir -p -v "$DEFAULT_BUILD_DIR"/swcContents
/usr/bin/unzip -o "$NATIVEEXTENSION_SWC" -d "$DEFAULT_BUILD_DIR"/swcContents
cp -f "$DEFAULT_BUILD_DIR"/swcContents/library.swf "$BUILD_DIR"/default
rm -rf "$DEFAULT_BUILD_DIR"/swcContents

cp -f "$BUILD_DIR"/library.swf "$BUILD_DIR"/ios
cp -f "$BUILD_DIR"/library.swf "$BUILD_DIR"/android
cp -f "$IOS_LIB_FILE" "$BUILD_DIR"/ios
cp -f "$IOS_PLATFORM" "$BUILD_DIR"/ios
cp -f "$JAR_LIB_FILE" "$BUILD_DIR"/android

adt -package -target ane "$BUILD_DIR"/"$ANE_NAME".ane extension.xml\
    -swc "$NATIVEEXTENSION_SWC"\
    -platform default -C "$BUILD_DIR"/default .\
    -platform iPhone-ARM\
      -platformoptions "$BUILD_DIR"/ios/platformoptions.xml -C "$BUILD_DIR"/ios .\
    -platform Android-ARM\
      -C "$BUILD_DIR"/android .


cp -f "$BUILD_DIR"/"$ANE_NAME".ane "$USING_DIR"
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?