当我使用-raw-metadata参数时,Flex编译器中断

时间:2013-03-14 04:17:06

标签: actionscript-3 flex actionscript metadata mxmlc

所以我有这个shell脚本将我的AS3类编译为SWF格式。

今天我想在元数据列表的“date”参数中添加一个花哨的时间戳。我正在尝试使用编译器选项-raw-metadata,但每次我尝试编译它都会给我这个错误:

Adobe Flex Compiler (mxmlc)
Version 4.6.0 build 23201
Copyright (c) 2004-2011 Adobe Systems, Inc. All rights reserved.

command line: Error: default arguments may not be interspersed with other options

Use 'mxmlc -help' for information about using the command line.

你们有没有想过为什么会发生这种情况?我做了些蠢事吗? 如果我不使用-raw-metadata但是单独设置每个参数,它就可以正常工作。

这是我的构建过程(Makefile):

# 
# Rafael Rinaldi (rafaelrinaldi.com)
# Feb 20, 2013
# 

# Flex compiler.
mxmlc=/Users/rafaelrinaldi/Code/Flash/SDK/flex_sdk_4.6/bin/mxmlc

# Flash player.
player=/Applications/Adobe\ Flash\ CS6/Players/Debug/Flash\ Player\ Debugger.app

# Setup.
main=./src/Main.as
libraries=./libs
swc=./swc
source-path=./src
output=./bin/static/Main.swf
run=$(output)

# .swf settings.
fp=11.1
fps=60
bg=0xFFFFFF
dimension=865,720

# Flags.
as3=true
debug=true
strict=true

# Application info.
title=Main
creator=Rafael Rinaldi (rafaelrinaldi.com)
publisher=Rafael Rinaldi (rafaelrinaldi.com)
description=My application.
language=en-US
date=$(shell date +'%B %d, %Y')
timestamp=$(shell date +'%D %T')

# SWF meta data.
define swf_metadata
<metadata>
    <title>$(title)</title> 
    <description>$(description)</description> 
    <publisher>$(publisher)</publisher> 
    <creator>$(creator)</creator> 
    <language>$(language)</language>
    <date>$(timestamp)</date>
</metadata>
endef

export swf_metadata

all: compile run

# Compile main file into a .swf
compile:
    @echo "\nCompiling '$(main)'...\n"
    @$(mxmlc) \
    -as3=$(as3) \
    -debug=$(debug) \
    -strict=$(strict) \
    -target-player=$(fp) \
    -default-frame-rate=$(fps) \
    -default-background-color=$(bg) \
    -default-size=$(dimension) \
    -static-link-runtime-shared-libraries=true \
    -source-path=$(source-path) \
    -source-path+=$(libraries) \
    -library-path=$(swc) \
    $(main) \
    -raw-metadata=$$swf_metadata \
    -o $(output)
    @echo "\nCompiled '$(output)' at `date "+%H:%M of %d/%m"`."

# Runs the application.
run:
    @echo "\nRunning '$(run)'\n"
    @open -a $(player) $(run)

# Aliases.
c: compile
r: run

.PHONY: all

0 个答案:

没有答案