Jenkins build u3d Auto Release IOS

Source: Internet
Author: User
Tags version control system

Http://www.cnblogs.com/yinghuochong/archive/2013/09/01/3294940.html

1. Install the package, the tool is skipped.

2. Plugin Management

Subversion Plug-inthis Plugin adds the Subversion support (via Svnkit) to jenkins.testflight pluginthis plugin would upload . IPA or. apk file (s) to testflightapp.com for distribution. Xcode pluginthis Plugin provides builders to build Xcode projects, invoke Agvtool and package. IPA Filestoken Macro Plugin This plug-in adds reusable macro expansion capability for other plug-ins to use. SCM API Pluginthis Plugin provides a new enhanced API for interacting with SCM systems. CVS Plug-inintegrates Jenkins with CVS version control system using a modified version of the Netbeans cvsclient. git pluginthis plugin integrates git with Jenkins. 3. New project start configuration steps:

1> source management: SVN updates code Engineering and resources.

2> build triggers, you can not specify the time to build your own Poll SCM H 22 * * * "build automatically at 22 points per day"

3> add Execute Shell Step

CP $WORKSPACE/tools/postprocessbuildplayer $WORKSPACE/code/assets/editor/
chmod +x $WORKSPACE/code/assets/editor/postprocessbuildplayer

RM-RF $WORKSPACE/build
Mkdir-p $WORKSPACE/build

echo Start building Unity project to IOS Project .....
/applications/unity/unity.app/contents/macos/unity-projectpath $WORKSPACE/code-executemethod Performbuild.commandlinebuild-batchmode-quit-logfile $WORKSPACE/build/log.txt

Echo Copy resource to build directory .....
Mkdir-p ${workspace}/build/iphone/data/clientres
Cp-r ${workspace}/clientres/config ${workspace}/build/iphone/data/clientres
Cp-r ${workspace}/clientres/assetbundles_ios ${workspace}/build/iphone/data/clientres
RM-RF ${WORKSPACE}/BUILD/IPHONE/DATA/CLIENTRES/CONFIG/.SVN
RM-RF ${WORKSPACE}/BUILD/IPHONE/DATA/CLIENTRES/ASSETBUNDLES_IOS/.SVN

Python $WORKSPACE/tools/updateinfo.py ${workspace}/build/iphone 0.6 ${build_number}

4>. Xcode Project Export IPA.

5.

CD ${workspace}/build/distributes
Mkdir-p Dragonbone-0.6.${build_number}
CP *.ipa Dragonbone-0.6.${build_number}\

# Generate. plist file for wireless app distribution
echo "<?xml version=\" 1.0\ "encoding=\" utf-8\ "?>
<! DOCTYPE plist public \ "-//apple//dtd plist 1.0//en\" \ "http://www.apple.com/dtds/propertylist-1.0.dtd\" >
<plist version=\ "1.0\" >
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>__URL__</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.cdkoi.dragon</string>
<key>bundle-version</key>
<string>dragon 0.6.${build_number}</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>dragon Bone for Ios</string>
<key>subtitle</key>
<string>0.6.${BUILD_NUMBER}</string>
</dict>
</dict>
</array>
</dict>
</plist> ">" ${workspace}/build/distributes/dragonbone-0.6.${build_number}/app.plist ";
Cp-r ${workspace}/build/distributes/dragonbone-0.6.${build_number} ~/distributes

===========updateinfo.py content ===========

#-*-Coding:utf-8-*-
#!/usr/bin/python

Import Sys
Import OS

Prduct_name = "XXX"
Cbundleidentifier = "Com.cdkoi.dragon"

def process_info (Info_filename, Product_Name, Bundle_version, build_version):
info_plist = open (Info_filename, ' R ')
lines = Info_plist.readlines ()
Info_plist.close ()

info_plist = open (Info_filename, ' W ')

# now iterate through the project adding any new lines where needed
i = 0
Steponeline = False
For I in range (0, Len (lines)):
if Steponeline = = False:
line = Lines[i]
Info_plist.write (line)
Steponeline = False

If Line.strip () = = "<key>CFBundleName</key>":
Info_plist.write ("\ T" + "<string>" + prduct_name + "</string>" + ' \ n ')
Steponeline = True

If Line.strip () = = "<key>CFBundleDisplayName</key>":
Info_plist.write ("\ T" + "<string>" + prduct_name + "</string>" + ' \ n ')
Steponeline = True

if line = = ' <key>CFBundleShortVersionString</key> ':
Info_plist.write ("<string>1.0</string>" + ' \ n ')
Steponeline = True

if line = = ' <key>CFBundleVersion</key> ':
Info_plist.write ("<string>1.0</string>" + ' \ n ')
Steponeline = True
Else
Steponeline = False

Info_plist.close ()


# Script Start
Print "Starting Modify info.plist with the following arguments ..."

i = 0
For args in SYS.ARGV:
Print str (i) + ': ' + args
i + = 1

# Check This was an IOS build before running
If Len (sys.argv) = = 4:

Info_full_path_name = sys.argv[1] + '/info.plist '
Process_info (Info_full_path_name, "Bone of the Dragon", "1.0", "1.0")

Jenkins build u3d Auto Release IOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.