CN105159705B - A kind of method and system being packaged indefinite number project file based on xcodebuild - Google Patents

A kind of method and system being packaged indefinite number project file based on xcodebuild Download PDF

Info

Publication number
CN105159705B
CN105159705B CN201510483442.0A CN201510483442A CN105159705B CN 105159705 B CN105159705 B CN 105159705B CN 201510483442 A CN201510483442 A CN 201510483442A CN 105159705 B CN105159705 B CN 105159705B
Authority
CN
China
Prior art keywords
file
sequence number
value
index sequence
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510483442.0A
Other languages
Chinese (zh)
Other versions
CN105159705A (en
Inventor
白晓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Si Tech Information Technology Co Ltd
Original Assignee
Beijing Si Tech Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Si Tech Information Technology Co Ltd filed Critical Beijing Si Tech Information Technology Co Ltd
Priority to CN201510483442.0A priority Critical patent/CN105159705B/en
Publication of CN105159705A publication Critical patent/CN105159705A/en
Application granted granted Critical
Publication of CN105159705B publication Critical patent/CN105159705B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention relates to a kind of method and system being packaged indefinite number project file based on xcodebuild, and the method includes generating file initial sequence number;Resource sequence number, index sequence number and .h file index sequence numbers are generated according to file initial sequence number;The correct position of engineering configuration file is write by the resource sequence number, index sequence number and .h file indexes sequence number and relevant information, realizes the modification of engineering profile rules;According to the file initial sequence number of generation and the configuration file of alteration ruler, xcode engineering compilings is used not know the file of number.The method generates the sequence number of file through the invention, and sequence number is write to the correct position of engineering configuration file, realizes the modification of engineering profile rules;After having used dynamic addition xcodebuild compiling options, it can be correctly packaged ipa, even if mistake or abnormal occurs when being packaged, xcode engineerings can also be opened and modified, it is very convenient.

Description

A kind of method and system being packaged indefinite number project file based on xcodebuild
Technical field
The present invention relates to project file processing technology fields, more particularly to a kind of xcodebuild that is based on to be packaged indefinite number The method and system of project file.
Background technology
Xcodebuild is a kind of order that IOS is compiled packing based on xcode tools.When using the order, need There are one correct project.pbxproj configuration files, the file structure of entire xcode engineerings is described in this document, such as The grouping situation and hierarchical relationship of file;Also illustrate library file, resource file and the .m files for participating in compiling.
When the add file into xcode engineerings, project.pbxproj needs to make corresponding change, In project.pbxproj, each file has one's own unique sequence number, these sequence numbers to have the generation of oneself Rule.If sequence number is incorrect, it will cause xcode engineerings that can not open, the results such as compile error.
Although and general makefile classes technology can be completed to be packaged, and still can not solve xcode engineerings and beat not The problem of opening.
Invention content
The technical problem to be solved by the present invention is in view of the deficiencies of the prior art, provide one kind to beat based on xcodebuild Wrap the method and system of indefinite number project file.
The technical solution that the present invention solves above-mentioned technical problem is as follows:One kind being packaged indefinite number work based on xcodebuild The method of journey file, includes the following steps:
Step 1, file initial sequence number is generated;
Step 2, resource sequence number, index sequence number and .h file index sequence numbers are generated according to file initial sequence number;
Step 3, work is write by the resource sequence number, index sequence number and .h file indexes sequence number and relevant information The modification of engineering profile rules is realized in the correct position of journey configuration file;
Step 4, it according to the file initial sequence number of generation and the configuration file of alteration ruler, is compiled using xcode engineerings Translate the file of uncertain number.
The beneficial effects of the invention are as follows:The method generates the sequence number of file through the invention, and sequence number is write The modification of engineering profile rules is realized in the correct position of engineering configuration file;Using dynamic addition xcodebuild After compiling option, it can be correctly packaged ipa, even if mistake or abnormal occurs when being packaged, xcode engineerings can also be opened It modifies, it is very convenient.
Based on the above technical solution, the present invention can also be improved as follows.
Further, the concrete operations of step 1 are:
Step 1.1, the position subscript value p1 where searching class file name in the character string of engineering configuration file, and obtain Character string str1 after subscript value p1;
Step 1.2, the subscript value p2 of the latter character of character string " fileRef=" is searched from character string str1;
Step 1.3, the character string strRet, strRet, that is, file initiation sequence of 24 characters after subscript value p2 are obtained Number.
Further, the concrete operations of step 2 are:
Step 2.1, character string strRet is converted into character array as resource sequence number, index sequence number and .h files The initial value of index sequence number;
Step 2.2,3 are added to obtain resource sequence number the value on 5 positions of strRet, by the value on 6 positions of strRet Add 2 to obtain index sequence number, adds 1 to obtain .h file index sequence numbers the value on 7 positions of strRet;
Step 2.3, the value on the position of the 11 of resource sequence number, 12 and 13 is added 1;
It step 2.4, respectively will be on resource sequence number, index sequence number and .h file indexes sequence number 14,15 and 16 positions Value be changed to 0;
Step 2.5, the resource sequence number made, index sequence number and .h file index sequence numbers are preserved.
Further, the concrete operations of step 3 are:
Step 3.1, the sequence number of file is obtained according to file name;
Step 3.2, four template strings are obtained according to obtained sequence number;
Step 3.3, four template strings are added separately to engineering configuration file project.pbxproj's In tetra- regions PBXBuildFile, PBXFileReference, PBXGroup, PBXResourcesBuildPhase;
Step 3.4, engineering configuration file is preserved.
Another technical solution that the present invention solves above-mentioned technical problem is as follows:One kind being packaged indefinite based on xcodebuild The system of number project file, including initial sequence number generation module, file serial number generation module, engineering configuration file change mould Block and file packetization module;
The initial sequence number generation module, is used to generate file initial sequence number;
The file serial number generation module is used to generate resource sequence number, index sequence according to file initial sequence number Row number and .h file index sequence numbers;
The engineering configuration file modified module is used for through the resource sequence number, index sequence number and .h files Index sequence number and relevant information write the correct position of engineering configuration file, realize the modification of engineering profile rules;
The file packetization module is used for according to the file initial sequence number of generation and the configuration text of alteration ruler Part does not know the file of number using xcode engineering compilings.
Based on the above technical solution, the present invention can also be improved as follows.
Further, the initial sequence number generation module specifically proceeds as follows:From the character string of engineering configuration file The middle position subscript value p1 searched where class file name, and obtain the character string str1 after subscript value p1;From character string str1 The subscript value p2 of the middle the latter character for searching character string " fileRef=";The character of 24 characters after acquisition subscript value p2 String strRet, strRet, that is, file initial sequence number.
Further, the file serial number generation module specifically proceeds as follows:Character string strRet is converted into word Array is accorded with as resource sequence number, the initial value of index sequence number and .h file index sequence numbers;By the value on 5 positions of strRet Add 3 to obtain resource sequence number, adds 2 to obtain index sequence number the value on 6 positions of strRet, it will be on 7 positions of strRet Value adds 1 to obtain .h file index sequence numbers;Value on the position of the 11 of resource sequence number, 12 and 13 is added 1;Respectively by resource sequence Number, the value on index sequence number and .h file indexes sequence number 14,15 and 16 positions be changed to 0;Preserve the resource sequence made Row number, index sequence number and .h file index sequence numbers.
Further, the engineering configuration file modified module specifically proceeds as follows:File is obtained according to file name Sequence number;Four template strings are obtained according to obtained sequence number;Four template strings are added separately to engineering configuration file PBXBuildFile, PBXFileReference of project.pbxproj, PBXGroup, In tetra- regions PBXResourcesBuildPhase;Preserve engineering configuration file.
Description of the drawings
Fig. 1 is a kind of method flow diagram being packaged indefinite number project file based on xcodebuild of the present invention;
Fig. 2 is a kind of system block diagram being packaged indefinite number project file based on xcodebuild of the present invention.
In attached drawing, parts list represented by the reference numerals are as follows:
1, initial sequence number generation module, 2, file serial number generation module, 3, engineering configuration file modified module, 4, text Part packetization module.
Specific implementation mode
The principle and features of the present invention will be described below with reference to the accompanying drawings, and the given examples are served only to explain the present invention, and It is non-to be used to limit the scope of the present invention.
As shown in Figure 1, a kind of method being packaged indefinite number project file based on xcodebuild, includes the following steps:
Step 1, file initial sequence number is generated;
Step 2, resource sequence number, index sequence number and .h file index sequence numbers are generated according to file initial sequence number;
Step 3, work is write by the resource sequence number, index sequence number and .h file indexes sequence number and relevant information The modification of engineering profile rules is realized in the correct position of journey configuration file;
Step 4, it according to the file initial sequence number of generation and the configuration file of alteration ruler, is compiled using xcode engineerings Translate the file of uncertain number.
Specifically, the concrete operations of step 1 are:
Step 1.1, the position subscript value p1 where searching class file name in the character string of engineering configuration file, and obtain Character string str1 after subscript value p1;
Step 1.2, the subscript value p2 of the latter character of character string " fileRef=" is searched from character string str1;
Step 1.3, the character string strRet, strRet, that is, file initiation sequence of 24 characters after subscript value p2 are obtained Number.
The concrete operations of step 2 are:
Step 2.1, character string strRet is converted into character array as resource sequence number, index sequence number and .h files The initial value of index sequence number;
Step 2.2,3 are added to obtain resource sequence number the value on 5 positions of strRet, by the value on 6 positions of strRet Add 2 to obtain index sequence number, adds 1 to obtain .h file index sequence numbers the value on 7 positions of strRet;
Step 2.3, the value on the position of the 11 of resource sequence number, 12 and 13 is added 1;
It step 2.4, respectively will be on resource sequence number, index sequence number and .h file indexes sequence number 14,15 and 16 positions Value be changed to 0;
Step 2.5, the resource sequence number made, index sequence number and .h file index sequence numbers are preserved.
The concrete operations of step 3 are:
Step 3.1, the sequence number of file is obtained according to file name;
Step 3.2, four template strings are obtained according to obtained sequence number;
Step 3.3, four template strings are added separately to engineering configuration file project.pbxproj's In tetra- regions PBXBuildFile, PBXFileReference, PBXGroup, PBXResourcesBuildPhase;
Step 3.4, engineering configuration file is preserved.
As shown in Fig. 2, a kind of system that indefinite number project file is packaged based on xcodebuild, including initial sequence number Generation module 1, file serial number generation module 2, engineering configuration file modified module 3 and file packetization module 4;The initial sequence Row number generation module 1 is used to generate file initial sequence number;The file serial number generation module 2, is used for according to file Initial sequence number generates resource sequence number, index sequence number and .h file index sequence numbers;The engineering configuration file changes mould Block 3 is used to write engineering by the resource sequence number, index sequence number and .h file indexes sequence number and relevant information and match The correct position of file is set, realizes the modification of engineering profile rules;The file packetization module 4, is used for according to generation File initial sequence number and the configuration file of alteration ruler, use xcode engineering compilings not know the file of number.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.

Claims (8)

1. a kind of method being packaged indefinite number project file based on xcodebuild, which is characterized in that include the following steps:
Step 1, file initial sequence number is generated;
Step 2, resource sequence number, index sequence number and .h file index sequence numbers are generated according to file initial sequence number;
Step 3, engineering is write by the resource sequence number, index sequence number and .h file indexes sequence number and relevant information to match The correct position of file is set, realizes the modification of engineering profile rules;
Step 4, it according to the file initial sequence number of generation and the engineering configuration file of alteration ruler, is compiled using xcode engineerings Translate the project file of uncertain number.
2. a kind of method being packaged indefinite number project file based on xcodebuild, feature exist according to claim 1 In the concrete operations of step 1 are:
Step 1.1, the position subscript value p1 where searching class file name in the character string of engineering configuration file, and obtain subscript Character string str1 after value p1;
Step 1.2, the subscript value p2 of the latter character of character string " fileRef=" is searched from character string str1;
Step 1.3, the character string strRet, strRet, that is, file initial sequence number of 24 characters after subscript value p2 are obtained.
3. a kind of method being packaged indefinite number project file based on xcodebuild, feature exist according to claim 1 In the concrete operations of step 2 are:
Step 2.1, character string strRet is converted into character array, as resource sequence number, index sequence number and .h file ropes Draw the initial value of sequence number;
Step 2.2, add 3 to obtain resource sequence number the value on 5 positions of strRet, add 2 to obtain the value on 6 positions of strRet To index sequence number, 1 is added to obtain .h file index sequence numbers the value on 7 positions of strRet;
Step 2.3, the value on the position of the 11 of resource sequence number, 12 and 13 is added 1;
Step 2.4, respectively by the value on resource sequence number, index sequence number and .h file indexes sequence number 14,15 and 16 positions It is changed to 0;
Step 2.5, the resource sequence number made, index sequence number and .h file index sequence numbers are preserved.
4. a kind of method being packaged indefinite number project file based on xcodebuild, feature exist according to claim 1 In the concrete operations of step 3 are:
Step 3.1, resource sequence number, index sequence number and .h file index sequence numbers are obtained according to file name;
Step 3.2, according to obtain resource sequence number, index sequence number and .h file index sequence numbers obtain four template strings;
Step 3.3, by four template strings be added separately to engineering configuration file project.pbxproj PBXBuildFile, In tetra- regions PBXFileReference, PBXGroup, PBXResourcesBuildPhase;
Step 3.4, engineering configuration file is preserved.
5. a kind of system being packaged indefinite number project file based on xcodebuild, which is characterized in that including initial sequence number Generation module, file serial number generation module, engineering configuration file modified module and file packetization module;
The initial sequence number generation module, is used to generate file initial sequence number;
The file serial number generation module is used to generate resource sequence number, index sequence number according to file initial sequence number With .h file index sequence numbers;
The engineering configuration file modified module is used for through the resource sequence number, index sequence number and .h file indexes Sequence number and relevant information write the correct position of engineering configuration file, realize the modification of engineering profile rules;
The file packetization module is used for the file initial sequence number according to generation and the engineering of alteration ruler has configured text Part does not know the project file of number using xcode engineering compilings.
6. a kind of system being packaged indefinite number project file based on xcodebuild, feature exist according to claim 5 In the initial sequence number generation module specifically proceeds as follows:Class file is searched from the character string of engineering configuration file Position subscript value p1 where name, and obtain the character string str1 after subscript value p1;Character string is searched from character string str1 The subscript value p2 of the latter character of " fileRef=";The character string strRet of 24 characters after acquisition subscript value p2, StrRet, that is, file initial sequence number.
7. a kind of system being packaged indefinite number project file based on xcodebuild, feature exist according to claim 5 In the file serial number generation module specifically proceeds as follows:Character string strRet is converted into character array, as The initial value of resource sequence number, index sequence number and .h file index sequence numbers;3 are added to be provided the value on 5 positions of strRet Source sequence number, adds 2 to obtain index sequence number the value on 6 positions of strRet, adds 1 to obtain the value on 7 positions of strRet .h file index sequence number;Value on the position of the 11 of resource sequence number, 12 and 13 is added 1;Respectively by resource sequence number, index sequence Value in row number and .h file indexes sequence number 14,15 and 16 positions is changed to 0;Preserve the resource sequence number made, index Sequence number and .h file index sequence numbers.
8. a kind of system being packaged indefinite number project file based on xcodebuild, feature exist according to claim 5 In the engineering configuration file modified module specifically proceeds as follows:Resource sequence number, index sequence are obtained according to file name Row number and .h file index sequence numbers;Four are obtained according to resource sequence number, index sequence number and .h file index sequence numbers is obtained A template string;By four template strings be added separately to engineering configuration file project.pbxproj PBXBuildFile, In tetra- regions PBXFileReference, PBXGroup, PBXResourcesBuildPhase;Preserve engineering configuration file.
CN201510483442.0A 2015-08-07 2015-08-07 A kind of method and system being packaged indefinite number project file based on xcodebuild Active CN105159705B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510483442.0A CN105159705B (en) 2015-08-07 2015-08-07 A kind of method and system being packaged indefinite number project file based on xcodebuild

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510483442.0A CN105159705B (en) 2015-08-07 2015-08-07 A kind of method and system being packaged indefinite number project file based on xcodebuild

Publications (2)

Publication Number Publication Date
CN105159705A CN105159705A (en) 2015-12-16
CN105159705B true CN105159705B (en) 2018-07-17

Family

ID=54800570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510483442.0A Active CN105159705B (en) 2015-08-07 2015-08-07 A kind of method and system being packaged indefinite number project file based on xcodebuild

Country Status (1)

Country Link
CN (1) CN105159705B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744673A (en) * 2014-01-06 2014-04-23 北京乐动卓越科技有限公司 Resource allocation method based on iOS (Internet 0perating System) platform
CN103838584A (en) * 2014-03-26 2014-06-04 北京京东尚科信息技术有限公司 Development method and device for mobile terminal application
CN104503746A (en) * 2014-12-11 2015-04-08 北京金和软件股份有限公司 Method for quickly packaging IOS (internetwork operating system) application program on APP development platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100126476A (en) * 2008-03-04 2010-12-01 애플 인크. Managing code entitlements for software developers in secure operating environments

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103744673A (en) * 2014-01-06 2014-04-23 北京乐动卓越科技有限公司 Resource allocation method based on iOS (Internet 0perating System) platform
CN103838584A (en) * 2014-03-26 2014-06-04 北京京东尚科信息技术有限公司 Development method and device for mobile terminal application
CN104503746A (en) * 2014-12-11 2015-04-08 北京金和软件股份有限公司 Method for quickly packaging IOS (internetwork operating system) application program on APP development platform

Also Published As

Publication number Publication date
CN105159705A (en) 2015-12-16

Similar Documents

Publication Publication Date Title
Bast et al. A benchmark and evaluation for text extraction from PDF
CN105335412B (en) For data conversion, the method and apparatus of Data Migration
CN108595921B (en) Method and device for confusing character strings in source codes
Miller et al. Spores: A type-based foundation for closures in the age of concurrency and distribution
Greifenberg et al. Engineering tagging languages for DSLs
CN105389195B (en) A kind of static analysis tools improved method replaced based on code with regular expression
US9870351B2 (en) Annotating embedded tables
Radziszewski et al. Maca–a configurable tool to integrate Polish morphological data
CN104407872A (en) Code clone detection method
CN106850531A (en) A kind of protocol code generation method based on template
Donatelli et al. Saarland at MRP 2019: Compositional parsing across all graphbanks
CN109857458A (en) The method for transformation of the flattening of AltaRica 3.0 based on ANTLR
CN103886095B (en) Cross-platform file destination multiplexing method
CN105159705B (en) A kind of method and system being packaged indefinite number project file based on xcodebuild
Yue Transition from EBNF to Xtext
Drewes et al. Contextual hyperedge replacement grammars for abstract meaning representations
CN104391831A (en) Method and system for commenting file contents
CN104462157A (en) Method and device for secondary structuralizing of text data
Hudík et al. The integration of moses into localization industry
CN104484156A (en) Editing method for multilingual formula, editing system for multilingual formula and editor for multilingual formula
US9916315B2 (en) Computer implemented system and method for comparing at least two visual programming language files
Bharati et al. Ssf: A common representation scheme for language analysis for language technology infrastructure development
JP6502044B2 (en) Data analysis device, data analysis method, and program.
Tamburini Semgrex-plus: a tool for automatic dependency-graph rewriting
Pichler Extraction of documentation from Fortran 90 source code: An industrial experience

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant