1

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

今天我想在元数据列表的“日期”参数中添加一个精美的时间戳。我正在尝试使用编译器选项-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
4

0 回答 0