Skip to content

Instantly share code, notes, and snippets.

@marcin-maciukiewicz
Created April 6, 2010 23:20

Revisions

  1. @cSquirrel cSquirrel revised this gist Apr 7, 2010. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions BuildDiskImage.sh
    Original file line number Diff line number Diff line change
    @@ -1,32 +1,32 @@
    # Set the destroot
    # Destination root for the framework
    DESTROOT="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}-${CURRENT_PROJECT_VERSION}"
    mkdir -p "${DESTROOT}"

    # Per-platform framework destinations
    #
    IPHONE_DEST="${DESTROOT}/iPhone Framework"
    DOC_DEST="${DESTROOT}/Documentation"

    # Populate the destroot
    # Populate the framework folder
    mkdir -p "${IPHONE_DEST}"
    tar -C "${BUILT_PRODUCTS_DIR}" -cf - "${PRODUCT_NAME}.framework" | tar -C "${IPHONE_DEST}" -xf -

    # Build documentation (or not)
    BUILD_DOCUMENTATION="no"
    if [ -x `which doxygen` -a "${BUILD_DOCUMENTATION}" = "yes" ]; then
    pushd "${SRCROOT}" >/dev/null
    pushd "${SRCROOT}" >/dev/null
    doxygen
    if [ $? != 0 ]; then
    echo "ERROR: Documentation generation failed" >/dev/stderr
    echo "ERROR: Documentation generation failed" >/dev/stderr
    exit 1
    fi
    popd >/dev/null
    popd >/dev/null

    rm -rf "${DOC_DEST}"
    rm -rf "${DOC_DEST}"
    mv Documentation "${DOC_DEST}"
    else
    echo "WARNING: Doxygen not available, skipping documentation generation" >/dev/stderr
    echo "WARNING: Doxygen not available, skipping documentation generation" >/dev/stderr
    fi

    # Create the disk image
    # Create the framework disk image
    rm -f "${DESTROOT}.dmg"
    hdiutil create -srcfolder "${DESTROOT}" "${DESTROOT}.dmg"
    hdiutil create -srcfolder "${DESTROOT}" "${DESTROOT}.dmg"
  2. @cSquirrel cSquirrel revised this gist Apr 7, 2010. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion BuildDiskImage.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,9 @@ DOC_DEST="${DESTROOT}/Documentation"
    mkdir -p "${IPHONE_DEST}"
    tar -C "${BUILT_PRODUCTS_DIR}" -cf - "${PRODUCT_NAME}.framework" | tar -C "${IPHONE_DEST}" -xf -

    if [ ! -z `which doxygen` ]; then
    # Build documentation (or not)
    BUILD_DOCUMENTATION="no"
    if [ -x `which doxygen` -a "${BUILD_DOCUMENTATION}" = "yes" ]; then
    pushd "${SRCROOT}" >/dev/null
    doxygen
    if [ $? != 0 ]; then
  3. @cSquirrel cSquirrel revised this gist Apr 6, 2010. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions BuildDiskImage.sh
    Original file line number Diff line number Diff line change
    @@ -8,21 +8,21 @@ DOC_DEST="${DESTROOT}/Documentation"

    # Populate the destroot
    mkdir -p "${IPHONE_DEST}"
    tar -C "${BUILD_DIR}/${CONFIGURATION}-iphoneos" -cf - "${PRODUCT_NAME}.framework" | tar -C "${IPHONE_DEST}" -xf -
    tar -C "${BUILT_PRODUCTS_DIR}" -cf - "${PRODUCT_NAME}.framework" | tar -C "${IPHONE_DEST}" -xf -

    if [ ! -z `which doxygen` ]; then
    pushd "${SRCROOT}" >/dev/null
    pushd "${SRCROOT}" >/dev/null
    doxygen
    if [ $? != 0 ]; then
    echo "ERROR: Documentation generation failed" >/dev/stderr
    echo "ERROR: Documentation generation failed" >/dev/stderr
    exit 1
    fi
    popd >/dev/null
    popd >/dev/null

    rm -rf "${DOC_DEST}"
    rm -rf "${DOC_DEST}"
    mv Documentation "${DOC_DEST}"
    else
    echo "WARNING: Doxygen not available, skipping documentation generation" >/dev/stderr
    echo "WARNING: Doxygen not available, skipping documentation generation" >/dev/stderr
    fi

    # Create the disk image
  4. @cSquirrel cSquirrel created this gist Apr 6, 2010.
    30 changes: 30 additions & 0 deletions BuildDiskImage.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    # Set the destroot
    DESTROOT="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}-${CURRENT_PROJECT_VERSION}"
    mkdir -p "${DESTROOT}"

    # Per-platform framework destinations
    IPHONE_DEST="${DESTROOT}/iPhone Framework"
    DOC_DEST="${DESTROOT}/Documentation"

    # Populate the destroot
    mkdir -p "${IPHONE_DEST}"
    tar -C "${BUILD_DIR}/${CONFIGURATION}-iphoneos" -cf - "${PRODUCT_NAME}.framework" | tar -C "${IPHONE_DEST}" -xf -

    if [ ! -z `which doxygen` ]; then
    pushd "${SRCROOT}" >/dev/null
    doxygen
    if [ $? != 0 ]; then
    echo "ERROR: Documentation generation failed" >/dev/stderr
    exit 1
    fi
    popd >/dev/null

    rm -rf "${DOC_DEST}"
    mv Documentation "${DOC_DEST}"
    else
    echo "WARNING: Doxygen not available, skipping documentation generation" >/dev/stderr
    fi

    # Create the disk image
    rm -f "${DESTROOT}.dmg"
    hdiutil create -srcfolder "${DESTROOT}" "${DESTROOT}.dmg"