CN117149252A - Program package volume adjustment method and device, electronic equipment and readable storage medium - Google Patents

Program package volume adjustment method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN117149252A
CN117149252A CN202310891559.7A CN202310891559A CN117149252A CN 117149252 A CN117149252 A CN 117149252A CN 202310891559 A CN202310891559 A CN 202310891559A CN 117149252 A CN117149252 A CN 117149252A
Authority
CN
China
Prior art keywords
file
configuration item
configuration
attribute value
project file
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.)
Pending
Application number
CN202310891559.7A
Other languages
Chinese (zh)
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.)
Guangzhou Boguan Information Technology Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202310891559.7A priority Critical patent/CN117149252A/en
Publication of CN117149252A publication Critical patent/CN117149252A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a method, a device and electronic equipment for adjusting the volume of a program package, wherein the method comprises the following steps: receiving an acquisition instruction of a project file of which the volume is to be adjusted, and acquiring the project file; determining a configuration item to be modified corresponding to the project file, and determining the current attribute value of the configuration item to be modified; the configuration item to be modified is used for adjusting the file content of the project file importing program package; when detecting that the current attribute value of the configuration item to be modified is different from the preset attribute value of the configuration item to be modified, modifying the current attribute value into the preset attribute value; and according to the configuration item to be modified with the preset attribute value, adjusting the corresponding program package volume of the project file in the compiling process of the project file. The method can simplify the operation flow of a user when adjusting the volume of the program package, reduce the interference of human factors in the process of adjusting the program package, reduce the operation error rate and improve the adjustment efficiency of the volume of the program package.

Description

Program package volume adjustment method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computers, and in particular, to a method and apparatus for adjusting the volume of a program package, an electronic device, and a computer readable storage medium.
Background
With the increase of services, the volume of a package generated in the application program development process increases sharply, and excessive volume of the package can cause that a user consumes excessive flow, time and space when downloading the package of the application program, so that the downloading rate of the application program by the user is reduced, and therefore, the volume of the package of the application program needs to be adjusted in the application program development process.
In the related art, the compilation setting of the Xcode development tool may be adjusted, so that the volume of the package is reduced when the package is generated according to the adjusted compilation setting. When the compiling setting of the Xcode development tool is adjusted, a user is often required to manually search configuration items related to the volume of the adjustment program package in configuration items corresponding to the compiling setting one by one in a compiling setting page provided by the Xcode development tool, and manually modify the attribute value of each configuration item.
In the actual adjustment process, a plurality of configuration items related to the volume adjustment of the program package exist, and the method of manually searching the configuration items one by one and modifying the attribute values is adopted, so that the operation flow is complex and the adjustment efficiency is low.
Disclosure of Invention
The application provides a method and a device for adjusting the volume of a program package, electronic equipment and a computer readable storage medium, which can simplify the operation flow of a user when adjusting the volume of the program package and improve the adjustment efficiency of the volume of the program package.
In a first aspect, an embodiment of the present application provides a method for adjusting a volume of a program package, where the method includes:
receiving an acquisition instruction of a project file of which the volume is to be adjusted, and acquiring the project file;
determining a configuration item to be modified corresponding to the project file, and determining the current attribute value of the configuration item to be modified; the configuration item to be modified is used for adjusting the file content of the project file importing program package;
when detecting that the current attribute value of the configuration item to be modified is different from the preset attribute value of the configuration item to be modified, modifying the current attribute value into the preset attribute value;
and according to the configuration item to be modified with the preset attribute value, adjusting the corresponding program package volume of the project file in the compiling process of the project file.
In a second aspect, an embodiment of the present application provides a volume adjustment device for a program package, including: the device comprises an acquisition unit, a determination unit, a modification unit and an adjustment unit;
The acquisition unit is used for receiving an acquisition instruction of a project file of which the volume is to be adjusted, and acquiring the project file;
the determining unit is used for determining a configuration item to be modified corresponding to the project file and a current attribute value of the configuration item to be modified; the configuration item to be modified is used for adjusting the file content of the project file importing program package;
the modification unit is configured to modify the current attribute value to a preset attribute value when detecting that the current attribute value of the configuration item to be modified is different from the preset attribute value of the configuration item to be modified;
the adjusting unit is used for adjusting the volume of the program package corresponding to the project file in the compiling process of the project file according to the configuration item to be modified with the preset attribute value.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a processor; and
a memory for storing a data processing program, the electronic device being powered on and executing the program by the processor, to perform the method as in the first aspect.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a data processing program for execution by a processor to perform a method as in the first aspect.
Compared with the prior art, the application has the following advantages: the electronic device receives an acquisition instruction of a project file of a program package volume to be adjusted, locally acquires the project file of the program package volume to be adjusted from the electronic device, and then determines a configuration item to be modified corresponding to the project file and a current attribute value of the configuration item to be modified, wherein the configuration item to be modified can be understood as a configuration item related to the program package volume corresponding to the program package volume to be adjusted, and specifically, the configuration item to be modified can be used for adjusting file content of a project file import program package. After determining the configuration item to be modified and the current attribute value thereof, the current attribute value of the configuration item to be modified and the preset attribute value preset by the configuration item to be modified can be matched, and the electronic equipment modifies the current attribute value into the preset attribute value under the condition that the current attribute value is detected to be different from the preset attribute value. Then, according to the configuration item to be modified with the preset attribute value, the volume of the program package corresponding to the project file can be adjusted when the project file is compiled, namely, the file content of the project file into which the program package can be imported is adjusted when the project file is compiled.
Therefore, according to the program package volume adjustment method provided by the application, a user can detect the configuration item to be modified and modify the attribute value of the configuration item to be modified, which are related to program package volume adjustment of the project file, only by carrying out the project file acquisition operation, so that the operation flow of the user when adjusting the program package volume is simplified, the interference of human factors in the program package adjustment process is reduced, the operation error rate is reduced, and the program package volume adjustment efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram showing an interface of a method for adjusting the volume of a program package according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an exemplary method for volume adjustment of a package according to an embodiment of the present application;
FIG. 3 is an interface diagram illustrating an exemplary method for adjusting the volume of a package according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another interface of a method for adjusting the volume of a package according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a file structure of an exemplary project file of a method for adjusting a volume of a package according to an embodiment of the present application;
FIG. 6 is a schematic diagram of another interface of a method for adjusting the volume of a package according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a volume adjustment device for a package according to an embodiment of the present application;
fig. 8 is a block diagram of an electronic device for adjusting the volume of a package according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present application may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present application is not limited to the specific embodiments disclosed below.
It should be noted that the terms "first," "second," "third," and the like in the claims, description, and drawings of the present application are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. The data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and their variants are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in embodiments of the present application, "at least one" means one or more and "a plurality" means two or more. "and/or" is merely an association relationship describing an association object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. "comprising A, B and/or C" means comprising any 1 or any 2 or 3 of A, B, C.
It should be understood that in embodiments of the present application, "B corresponding to a", "a corresponding to B", or "B corresponding to a" means that B is associated with a from which B may be determined. Determining B from a does not mean determining B from a alone, but may also determine B from a and/or other information.
It should be noted that, in the embodiment of the present application, for convenience of reading, all the English related in the text of the embodiment of the present application is written in lower case, and the lower case of English is consistent with the upper case meaning in the accompanying drawings.
For ease of understanding, some of the terms or expressions referred to in the embodiments of the present application will be described first.
Xcode development tool: the system is an integrated development tool (IDE) running on an operating system Mac OS, is used for developing application programs of a Mac OS X platform and an IOS platform, has uniform user interface design, and realizes encoding, testing and debugging in a simple window.
The program package comprises the following steps: the program compiles the packaged file. Such as: the ipa (iPhoneApplication) format file of the IOS system is visually displayed as an xxx.ipa file, the program package mainly comprises executable files and resource files, the executable files refer to files which can be loaded and executed by an operating system, under the Mac operating system, the executable files are in Mach Object format, namely Mach-O file format, and under the windows operating system, the executable programs can be type files such as exe files, sys files, com and the like. The resource file includes fixed resources such as pictures, audio, video, etc. In this embodiment, the package is a package of an application program generated by an Xcode development tool.
Swift UI development tool: is a declarative framework built based on the Swift programming language, and the framework can be used for application development of platforms such as watchOS, tvOS, macOS, IOS.
Xcodeacroj framework: the tool is a core component of a third-party version dependency library cocoaPods and is used for creating or modifying a project developed by using an Xcode development tool, and in the embodiment, the management of a configuration file corresponding to the project file can be performed through the tool.
debug mode: refers to a build mode for a debugger during software development. Contains debugging information and does not make any adjustment, thereby facilitating the debugging of the program by a programmer.
release mode: refers to a build mode used for release versions of a product during software development. Often, various adjustments are made to optimize the program in terms of code size and speed of operation for good use by the user. Typically, debug information is not included in the release version.
Target file (engineering file): the compiling setting files used for setting and generating different products can be understood as different Target files corresponding to different products. In this embodiment, the product may be understood as an Application (APP).
Project file (Project file): is a collection of project files for all files, resources, information/configurations of a project to be developed. One Project to be developed corresponds to one Project. One Project may have multiple targets, resulting in multiple different products. For example, project files for a game development Project may include a Target file for a free version, a Target file for a charged version, or a Target file for a holiday version, i.e., the game development Project may include a game product for a free version, a game product for a charged version, or a game product for a holiday version.
After understanding the above terms or terminology, the related art will be further described.
In the related art, the compilation setting of the Xcode development tool may be adjusted, so that the volume of the package is reduced when the package is generated according to the adjusted compilation setting. When the compiling setting of the Xcode development tool is adjusted, a user is often required to manually search configuration items related to the volume adjustment of the program package in configuration items of the compiling setting of the Xcode development tool one by one, manually modify attribute values of each configuration item, and then according to the modified configuration items.
Referring to fig. 1, when adjusting the compilation setting in the interface 100 of the Xcode development tool, click on the project name 101 that needs to adjust the package size, and enter the Build Settings tab 103 in the target file 102 corresponding to the project name 101, search for the configuration item that needs to be modified under the Build Settings tab 103, and modify the attribute value corresponding to the configuration item to an attribute value that can reduce the package size. For example, search control 104 in FIG. 1 searches for a configuration term "gcc_optimization_level" that can adjust the degree of optimization of the compiler, the attribute value of which is the level of adjustment of the code, e.g., none [ -O0] attribute value: indicating no adjustment; fast [ -O1] attribute values: indicating that level 1 adjustments are made, the compiler will adjust code performance and file size and minimally affect compile time, i.e., perform adjustments that do not require significant compile time; faster [ -O2] attribute value: representing the level 2 adjustment, the compiler performs all supported optimization options that do not involve time space swapping, further increasing the compilation time and the performance of code generation compared to O1; fastest [ -O3] attribute value: indicating that the level 3 adjustment is performed, the compiler can start all optimization options to improve the code execution efficiency, namely, the adjustment of a plurality of space change times is increased while all O2 optimization options are started; fatest, smallest [ -Os ]: the compiler will open all optimization options except for the one that will increase the packet size significantly, which guarantees the execution efficiency of the code without increasing the packet size, which is the best attribute value. After searching the configuration item gcc_optimization_level, checking whether the attribute value of the configuration item in the release mode is Fatest, smallest [ -Os ], if not, modifying. As shown in FIG. 1, the attribute value of the target configuration item "gcc_optimization_level" in Release mode is Fatest, smallest [ -Os ], and no modification is required.
In the same manner as described above, the attribute values of other configuration items related to the volume of the adjustment package in each configuration item corresponding to the compilation setting of the Xcode development tool can be manually retrieved and modified. Therefore, the operation flow for adjusting the compiling setting of the Xcode development tool is complicated and easy to operate and error, if a plurality of Target files exist in one project to be developed, the configuration items corresponding to each Target file and used for adjusting the package volume of the Target file need to be respectively retrieved and modified, the operation time is long, and the adjustment efficiency is low.
In addition, during the search process, the user needs to query configuration items from books or networks, etc., which may affect the size of the output package of the Xcode development tool, and the attribute values of the configuration items can not be modified in the Xcode after the query. In this case, the names of the configuration items queried by the user may not be consistent with the original names stored in the Xcode development tool, so that the user generates an error experience without the queried configuration items, which results in lower adjustment efficiency. For example, the target configuration item name input by the user shown in fig. 1 is "gcc_optimization_level", the original name searched in the Xcode development tool is "Optimization Level", and the user needs to carefully check whether the configuration items expressed by the two items are identical, so as to determine whether the attribute values of the configuration items need to be modified, which results in low volume adjustment efficiency on the program package.
Of course, in the related art, in addition to the above-mentioned method of adjusting the package volume by adjusting the compilation setting of the Xcode development tool, there is a method of adjusting the package volume by reducing the weight of the resource file in the project file or optimizing the source code, and this embodiment of the present application is not specifically described for these two methods, that is, the embodiment of the present application is a method of improving the adjustment of the compilation setting of the Xcode development tool to adjust the package volume.
Based on the above-mentioned problems, embodiments of the present application provide a method, an apparatus, an electronic device, and a computer-readable storage medium for adjusting a volume of a program package.
The method for adjusting the volume of the program package provided by the embodiment of the application can be executed by electronic equipment, and the electronic equipment can be equipment such as a terminal or a server. The terminal can be terminal equipment such as a smart phone, a tablet personal computer, a notebook computer and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligence platforms, and the like. It is to be understood that the present application is not limited to the execution subject of the volume adjustment method for executing the package.
Before describing the embodiments of the present application in detail, first, a core idea of the embodiments is described to facilitate a general understanding of the concept of the technical solution of the present application. In order to solve the problems that the compiling setting of the Xcode development tool is modified to achieve the purpose of adjusting the size of the package volume, and therefore the compiling setting adjustment efficiency of the Xcode development tool is low and the user operation is complicated, the technical scheme provided by the embodiment of the application enables a user to only need to perform the acquiring operation of the item file of the package volume to be adjusted, the electronic equipment acquires the item file of the package volume to be adjusted after detecting the acquiring operation triggered by the user, and then automatically searches the item file for the configuration items to be modified corresponding to the configuration items counted in advance according to the configuration items related to the package volume to be adjusted, and matches and modifies the current attribute values of the configuration items to be modified with the preset attribute values. The method simplifies the operation flow of a user when adjusting the volume of the program package, reduces the interference of human factors in the process of adjusting the program package, reduces the operation error rate and improves the adjustment efficiency of the volume of the program package.
The technical scheme of the application is described in detail through specific examples. It should be noted that the following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 2 is a flowchart illustrating an example of volume adjustment of a package according to an embodiment of the application. It should be noted that the steps shown may be performed in a different logical order than that shown in the method flow diagram. The method may include the following steps S210 to S240.
Step S210: and receiving an acquisition instruction of the project file of which the volume is to be adjusted, and acquiring the project file.
Step S220: and determining the configuration item to be modified corresponding to the project file and the current attribute value of the configuration item to be modified.
Step S230: and under the condition that the current attribute value of the configuration item to be modified is detected to be different from the preset attribute value of the configuration item to be modified, modifying the current attribute value into the preset attribute value.
Step S240: and according to the configuration item to be modified with the preset attribute value, adjusting the volume of the program package corresponding to the project file in the compiling process of the project file.
According to the program package volume adjusting method, a user can detect the configuration item to be modified and modify the attribute value of the configuration item to be modified, which are related to program package volume adjustment of the project file, only by carrying out the project file obtaining operation, so that the operation flow of the user when the program package volume is adjusted is simplified, the interference of human factors in the program package adjusting process is reduced, the operation error rate is reduced, and the program package volume adjusting efficiency is improved.
Next, the above steps S210 to S240 will be described in detail with reference to fig. 2 to 6.
Step S210: and receiving an acquisition instruction of the project file of which the volume is to be adjusted, and acquiring the project file.
The above-mentioned adjustment of the package volume may include decreasing the package volume or increasing the package volume, and is not particularly limited in this embodiment.
Project files may be understood as a collection of files of all files, resources, information or configurations of a project to be developed. For example, in a game development project, a project file is a collection of files that includes game source code, art resources, or configuration files that are involved in the game development process, although the content included in the project file is merely exemplary and not limiting.
In an alternative embodiment, to simplify the operation flow when the user adjusts the package volume, that is, simplify the operation flow when the user adjusts the compiling setting, the embodiment may develop an operation interface for adjusting the package volume function of the program, so that the user may execute the operation of obtaining the project file through the operation interface, thereby completing the adjustment process of the compiling setting of the development tool used when the project is developed. Or, the development tool can be subjected to function development, and a function control for adjusting the volume of the program package is added, so that a user can acquire the project file in the display interface of the original development tool. That is, the present embodiment is not limited to the embodiment for acquiring the project file, and the above two embodiments are exemplified. In this embodiment, the method is described taking a development tool as an example of developing a project for the Xcode development tool, that is, the compiling setting of the Xcode development tool is adjusted to achieve the purpose of adjusting the volume of the package generated by the Xcode development tool.
The following describes the manner of acquiring the project file through the operation interface for adjusting the volume function of the program package provided in this embodiment, so as to facilitate better understanding of the operation procedure of acquiring the project file by the user.
In this embodiment, an operation interface for adjusting the volume of the package may be made by a shift UI tool, and as shown in fig. 3, the operation interface 300 includes an adjustment control 10 and an adjustment result display area 11. Referring to fig. 4, by triggering the adjustment control 10, a file selection panel 12 is displayed in the operation interface 300, and the file selection panel 12 may include a search control 13, a selection control 14, and a file presentation view setting control 15. The search control 13 is configured to query, according to a file identifier of a project file input by a user, a project file corresponding to the file identifier from all project files locally stored in an electronic device where a target application program is located, where it can be understood that the file identifier herein may include identifiers that may be used for one-to-one correspondence with the project files, such as a file name, a file number, or a file icon, and the embodiment is not limited to any specific identifier; the selection control 14 is configured to enable a user to display all the project files locally stored in the electronic device in the operation interface 300 in a pull-down manner, so that the user can further select a project file with a volume to be adjusted from all the displayed project files; the file display view setting control 15 is used for setting a display style of the project file, which can be intuitively seen by a user in acquiring the project file, and the display style may include a list display style or a lattice display style, which is not specifically described in this embodiment.
In particular embodiments, after the user triggers the adjustment control 10, the electronic device may display the file selection panel 12 in the operator interface 300 by invoking the NSOpenPanel class. The NSOpenPanel class is used to provide a file selection panel for selecting files in Mac application development. More specifically, after the user creates the instance object corresponding to the NSOpenPanel class, each attribute of the instance object may be configured, where the instance object may be understood as an instance object of the file selection panel 12 displayed in the operation interface 300, and configuring each attribute of the instance object is configuring an attribute of the file selection panel 12, for example, an allowsmultiple attribute may be configured as "false", which may avoid a situation that too many item files are selected at a time, and when configured as "true", a plurality of item files may be selected at a time, that is, the allowsmultiple attribute is used to configure the number of selected item files; configuring the canchoosedirectors attribute to "false" may avoid the case where only the file directory is selected when selecting the project file, and setting the allowedFileTypes attribute to "com.apple.xcode.project" means that only the project file developed using the Xcode development tool is selected, i.e., the allowedFileTypes attribute is used to configure the selectable file types. The selection file using the NSOpenPanel class will not be described in detail here.
It may be understood that the embodiment of the present application does not limit the number of acquired project files, and may include one or more of detecting and modifying, in turn, the configuration item to be modified corresponding to each project file when a plurality of project files are acquired.
Step S220: and determining the configuration item to be modified corresponding to the project file and the current attribute value of the configuration item to be modified.
The configuration item to be modified is used for adjusting the file content of the project file importing program package. In other words, the configuration item to be modified is a configuration item related to adjusting the package volume among all the configuration items of the Xcode development tool. It will be appreciated that in this embodiment, the number of configuration items to be modified is not limited, and may include one or more.
In an optional implementation manner, after detecting that a user obtains a project file of a to-be-adjusted package volume through a file selection panel, the electronic device invokes the xcodeprot framework to analyze a file structure of the project file to obtain a configuration file corresponding to the project file, where the configuration file is used to manage a plurality of configuration items required for compiling the project file, so that the to-be-modified configuration item and a current attribute value of the to-be-modified configuration item can be determined in the plurality of configuration items of the configuration file. The above file structure can also be understood as a file path of the project file.
Based on the functional analysis of the configuration items in the Xcode development tool, configuration items related to adjusting the volume of the package can be counted in advance and configuration item identifications of the configuration items can be recorded. After the statistics of the configuration items related to the adjustment of the volume of the package, in an optional embodiment, the determining, among the plurality of configuration items of the configuration file, the configuration item to be modified corresponding to the item file and the current attribute value of the configuration item to be modified may be specifically implemented as follows steps A1 to A3.
Step A1: and acquiring a preset configuration item identifier.
Step A2: inquiring a target configuration item corresponding to a preset configuration item identifier in a plurality of configuration items, and determining the target configuration item as a configuration item to be modified;
step A3: and determining the current attribute value of the target configuration item as the current attribute value of the configuration item to be modified.
It will be appreciated that the configuration items in the configuration file all exist in the form of key-value pairs, and that keys, which are names of key-value pairs, may be used to store or retrieve corresponding values. Thus, in this embodiment, the target configuration item may be retrieved by previously setting the statistically derived configuration item identification of the configuration item related to the adjustment of the package volume. The preset configuration item identifier is a configuration item identifier corresponding to a configuration item related to the adjustment of the volume of the package obtained by statistics in advance. The configuration item identification may include information for marking the configuration item, such as a name or number of the configuration item, which is not particularly limited in this embodiment.
According to the preset configuration item identification, a plurality of configuration items in the configuration file can be traversed, a target configuration item corresponding to the preset configuration item identification is determined to be the configuration item to be modified, and the current attribute value of the target configuration item is determined to be the current attribute value of the configuration item to be modified.
In this embodiment, according to the functional division of each configuration item, the configuration item includes at least the following categories: a first configuration item for adjusting a compiler optimization degree for compiling the project file; a second configuration item for adjusting the size of the picture in the project file; a third configuration item for adjusting the code or function in the project file; and a fourth configuration item for adjusting a debug symbol when the project file is debugged.
The four categories of configuration items described above are exemplified below. As shown in table 1, table 1 is an example of a configuration item related to the volume adjustment of the package and an example of a current attribute value of each configuration item obtained by statistics in advance, and may also be regarded as an example of a configuration item to be modified and an example of a current attribute value of the configuration item to be modified.
Table 1 examples of configuration items related to adjusting package volume (examples of configuration items to be modified)
The configuration items shown in table 1, each of which is related to the adjustment of the package volume, are described in detail below, so that it is convenient to understand why the package volume can be adjusted by adjusting the configuration items.
The first configuration item may include a gcc_optimization_level configuration item and/or a swift_optimization_level configuration item shown in table 1. The gcc_optimization_level configuration item is used for adjusting the optimization degree of an OC (Objective-C) compiler, and the swift_optimization_level configuration item is used for adjusting the optimization degree of a Swift compiler. Specifically, both of the above configuration items enable the respective corresponding compilers to adjust the generated code in terms of speed and binary size. For example, additional size savings may be achieved by isolating duplicate code patterns into the compiler-generated functions.
It will be appreciated that the attribute values of the gcc_optimization_level configuration item and the swift_optimization_level configuration item are both optimization levels of the compiler. The description of the plurality of attribute values of the gcc_optimization_level configuration item may refer to the description of each attribute value in the related art, and will not be repeated herein. The attribute values of the swift_optimization_level configuration item may include: no optimizations attribute values, optimize for Speed attribute values, and Optimize for Size attribute values. The No Optimization attribute value indicates that the compiling result of the compiler is not optimized, the Optimize for Speed attribute value is used for optimizing the compiling speed of the compiler, and the Optimize for Size attribute value is used for reducing the size of a binary file obtained after the compiler compiles the project file. According to the functional analysis of the three attribute values of the swift_optimization_level configuration item, the preset attribute value of the swift_optimization_level configuration item can be set to be Optimize for Size attribute value, so that the content of the project file import program package can be reduced by reducing the size of the binary file output by the compiler.
The second configuration item may include an assetcatalog_compler_optimization configuration item shown in table 1. The attribute values of the asseatatalog_compiler_optimization configuration item may include a null attribute value, a space attribute value, a time attribute value. Different attribute values of the configuration item may respectively correspond to corresponding functions. The space attribute value can be used for specifying the compression strategy for the pictures in the project file, namely, when the attribute value of the asseatatalog_compiler_optimization configuration item is the space attribute value, the compiler can compress the pictures in the project file by adopting the specified compression strategy, so that the file content of the project file importing program package is reduced.
The third configuration item may include the llvm lto (llvm link time optimizer) configuration item shown in table 1. The configuration item can optimize various functions in the project file or clear redundant codes. For example, when a code that has never been used can be regarded as redundant code and the state of the configuration item is an on state, the redundant code can be deleted during compiling of the project file; or alternatively. The method and the device have the advantages that the internal adjustment is carried out on the codes of the project files, namely, partial functions in the codes are connected in an internal mode, the functions are directly unfolded at the called place, a compiler does not need to press the stack of parameters, release the stack of the parameters and release resources when returning like a general function during calling, the size of machine codes can be reduced to a certain extent, the repetition of the codes is reduced, and then the effect of adjusting the volume of a program package can be achieved.
The fourth configuration items may include Deployment Postprocessing, gcc Symbols Private Extern, copy_phase_ strip (Strip Debug Symbols During Copy), and/or strip_sampled_ product (Strip Linked Product) configuration items shown in table 1. That is, the four configuration items can optimize the debug symbol when the project file is to be debugged. Debug symbols are bridges that relate the binary information of the debuggee program to the source program information. By deleting redundant debugging symbols, the size of the project file after compiling can be reduced, and further the file content of the imported program package is reduced.
The Deployment Postprocessing configuration item is a master switch of the Strip command, and attribute values of the master switch are YES and NO, which are respectively used for indicating that the state of the configuration item is an on state and an off state. So-called Strip commands can selectively remove debug symbol information from project files. The copy_phase_strip configuration item is used for determining whether to carry out adjustment for removing useless debugging symbols on the final binary file, the attribute value of the copy_phase_strip configuration item comprises YES and NO, and when the attribute value is YES, the configuration item can remove redundant debugging symbols in the binary file. The strip_isolated_product configuration item is used for determining whether to perform adjustment for removing useless debugging symbols in a file copy compiling stage, wherein the attribute value comprises YES and NO, and when the attribute value is YES, the configuration item can remove redundant debugging symbols in the file copy compiling stage.
Note that the selection of the attribute values of copy_phase_strip configuration item and strip_isolated_product configuration item depends on the determination of the attribute values of Deployment Postprocessing configuration item. That is, only if the attribute value of the Deployment Postprocessing configuration item is YES, the copy_phase_strip configuration item and the strip_installed_product configuration item can be validated, and when the Deployment Postprocessing configuration item is in the off state, the copy_phase_strip configuration item and the strip_installed_product configuration item have no effect.
Gcc Symbols Private Extern, also referred to as Symbols Hidden by Default, configuration items whose attribute values may include both YES and NO, respectively, indicate that the state of the Gcc Symbols Private Extern configuration item is an on state and an off state. When the configuration item is in the on state, unnecessary debugging sign information in the project file can be removed, so that the volume of the program package is reduced.
Up to this point, the function description has been made for the configuration items related to the adjustment of the package volume provided in the present embodiment. It should be understood that the configuration items related to the adjustment of the package volume are merely examples, and are not limited to the configuration items to be modified in this embodiment.
After determining the configuration item to be modified and the current attribute of the configuration item to be modified according to step S220, the following step S230 is further performed.
Step S230: and under the condition that the current attribute value of the configuration item to be modified is detected to be different from the preset attribute value of the configuration item to be modified, modifying the current attribute value into the preset attribute value.
This step is used to modify the attribute values of the configuration items to be modified so that the configuration items to be modified can be used to adjust the volume of the package.
The preset attribute value of the configuration item to be modified may be understood as an attribute value related to the volume of the optimizing package in the configuration item to be modified.
As shown in table 2, table 2 provides examples of preset attribute values for configuration items to be modified.
The preset attribute value of the default_post processing configuration item may be YES, the preset attribute value of the default_optimization_level configuration item is-osize, the-osize attribute value corresponds to the Optimize for Size attribute value introduced above, the two represent the same meaning, osize is a representation of the Optimize for Size attribute value in the code, and Optimize for Size is a representation of the attribute value visualized in the Xcode development tool. As can be seen from the foregoing description of the attribute values of each configuration item to be modified, setting the preset attribute value of the configuration item to be modified to YES and the preset attribute value of the configuration item to be swift_optimization_level to be-size can achieve the effect of optimizing the package volume, and the preset attribute values of the remaining configuration items to be modified refer to table 2.
Table 2 target attribute value example of configuration item to be modified
Therefore, after determining the current attribute value of the configuration item to be modified according to step S220, the current attribute value of the configuration item to be modified is matched with the preset attribute value, and if the current attribute value is different from the preset attribute value, the current attribute value can be modified into the preset attribute value. For example, the current attribute value of the Deployment Postprocessing configuration item shown in table 1 is NO, and the preset attribute value of the configuration item shown in table 2 is YES, that is, the current attribute value of the configuration item is different from the target attribute value, then the current attribute value NO of the configuration item is modified to be the preset attribute value YES, that is, the Deployment Postprocessing configuration item is adjusted from the current off state to the on state, so that the volume of the package can be adjusted according to the Deployment Postprocessing configuration item in the on state.
Wherein the preset attribute value of gcc_optimization_level configuration item is denoted as z, which is the representation of the Fastest Smallest [ -Os ] attribute value in the code, that is, the z attribute value appearing in the embodiment has the same meaning as the Fastest Smallest [ -Os ] attribute value expression.
Of course, it will be understood that the current attribute values and the preset attribute values of the configuration items to be modified in table 1 and table 2 are examples, and are not limited thereto. In an alternative embodiment, if the preset attribute value in table 2 is used as the current attribute value in table 1 and the current attribute value in table 1 is used as the preset attribute value in table 2, the volume adjustment of the project file package may also be implemented, that is, the embodiment is not limited to the volume reduction of the package.
Step S240: and according to the configuration item to be modified with the preset attribute value, adjusting the volume of the program package corresponding to the project file in the compiling process of the project file.
After the attribute values of the configuration items to be modified are all preset attribute values, the configuration file is saved, and then compiling and packaging operations are carried out on the project files according to the configuration file, so that the volume of the program package of the project files is adjusted.
The first configuration item with the first preset attribute value is used for starting other optimization options except for the adjustment option for increasing the file content of the project file importing package in the compiling process of the project file, and/or multiplexing the continuous machine instruction repeated in the project file by an external linkage function, so that the file content of the project file importing package can be reduced.
For example, as shown in table 2, when the first configuration item is the gcc_optimization_level configuration item, the first preset attribute value is z, and all optimization options except for the adjustment option for adding the file content of the project file import package may be opened in the compiling process of the project file.
The second configuration item with the second preset attribute value is used for compressing the pictures in the project file according to the compression strategy corresponding to the third preset attribute value.
For example, when the second configuration item is an assetcatalog_compiler_optimization configuration item, the second preset attribute value is a space attribute value, and in the process of compiling the project file, pictures in the project file can be compressed according to a compression algorithm corresponding to the space attribute value, so that file content of the compiled project file is reduced, and further the volume of a program package is reduced.
The third preset attribute value of the third configuration item is used for adjusting the state of the third configuration item to be in an on state, so that the third configuration item with the third preset attribute value internalizes part of functions in the project file or removes redundant codes in the project file in the compiling process of the project file. For example, when the third configuration item is the llvm_ lto configuration item, the third preset attribute thereof is YES.
The fourth preset attribute value of the fourth configuration item is used for adjusting the state of the fourth configuration item to be in an on state, so that the fourth configuration item with the fourth preset attribute value removes redundant debugging symbols when compiling the project file in the compiling process of the project file. For example, when the fourth configuration item is the Deployment Postprocessing configuration item, the fourth preset attribute thereof is YES.
In an alternative embodiment, the configuration file may include a version file in debug mode (debug mode) and a configuration file in release mode (release mode). Reference may be made to the foregoing description of nouns or terms for debug mode as well as publish mode, which are not repeated here. For the configuration files in both modes, only the configuration file in the release mode is acquired in the present embodiment. Thus, after the size of the program package of the project file is adjusted, the subsequent development work of the project file is not influenced. In order to achieve that only the configuration file in the release mode is obtained, in this embodiment, firstly, the file identifier of the configuration file corresponding to the project file is obtained, and secondly, when the file identifier is detected to be the release version identifier, the configuration file in the release mode corresponding to the project file is obtained. It may be understood that the file identifier is a name or a number of a file, for example, the file identifier is debug or release, the file identifier is debug corresponds to a configuration file in the debug mode, the file identifier is release corresponds to a configuration file in the release mode, only when the file identifier is detected as release, the configuration file with the file identifier being release is obtained, and the configuration file is determined to be a configuration file corresponding to the project file.
It will be appreciated that when a file is obtained, it is generally necessary to parse a storage path of the file, and further obtain a corresponding file according to the path. Thus, in an alternative embodiment, the configuration file may be obtained by parsing the file structure of the project file. Next, a description is given of a file structure of the project file developed by using the Xcode development tool, and after knowing the file structure of the project file, the configuration file can be read step by step.
It can be understood that, according to the working mechanism of the Xcode development tool, the configuration items related to the adjustment of the package volume are stored in the configuration files corresponding to each Target file during the compiling process, so that determining the configuration file corresponding to the project file is to obtain the configuration file corresponding to each Target file in the project file.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a partial file structure of an item file in an embodiment of the present application. In this embodiment, the file structure of the project file may be parsed into a tree structure, where the project file includes a project description file with a file type of pbxproj, and the project description file may be regarded as a folder, in which source codes of projects developed by an Xcode development tool and various types of configuration files, that is, configuration information required for compiling the project file, are stored. In practical applications, the project file is modified by adding, deleting, checking, configuring and compiling parameters and the like. Therefore, in this embodiment, the configuration file corresponding to the project file is acquired, and the project description file needs to be acquired first, and then the configuration file is further acquired in the project description file.
As can be seen from FIG. 5, the project description file mainly includes two child node objects and a rootobject. Where objects are a dictionary containing all nodes, the rootobjects store elements that can point to the PBXProject nodes in the objects. The PBXProject node may include four major children, respectively a buildConfigurationList child, a main group child, a ProjectReferences child, and a PBXNativeTargrt child. The configuration list child node is used for managing configuration files of products corresponding to at least one Target file included in the project file, the main group child node corresponds to a structure of the project file, the project references correspond to reference relations among projects, and the PBXNativeTargrt child node is used for managing configuration files of products corresponding to at least one Target file included in the project file.
Referring to fig. 5, a pbxnetuttargrt child node may include a plurality of Target files, and for each Target file, three objects, respectively, a buildConfigurationList object, a dependencies object, and a buildbases object may be included. The buildConfigurationList object stores a configuration file corresponding to the Target file, configuration files in two modes of a debugging mode and a release mode exist in the buildConfigurationList object, the dependencies object stores file information of other Target files on which the Target file depends, and the buildbaus object stores file information, such as source codes or resources, required by compiling the Target file.
As can be seen from the foregoing description, in this embodiment, determining the configuration file corresponding to the project file is to obtain the configuration file corresponding to the Target file. Therefore, according to the file structure of the project file shown in fig. 5, when acquiring the configuration file, it can be specifically implemented as follows: firstly, acquiring an item description file, namely a pbxproj file, in an item file, then acquiring an engineering management file in the item description file, namely a PBXNativeTargrt subnode shown in fig. 5, further acquiring an engineering file in the subnode, then acquiring a buildConfigurationList object in the engineering file, and finally, selectively acquiring a buildConfigurationconfiguration file named Release in the object, wherein the buildConfigurationconfiguration file named Release is a configuration file corresponding to the item file to be determined in the embodiment. The configuration items stored in the configuration file are each configuration item under the Build Settings tab 103 in the Xcode interface 100 in fig. 1.
According to the working mechanism of the Xcode, one project file may correspond to at least one project file. For example, a project file of a game development project may include an engineering file of a free-play game, an engineering file of a charged-play game, or an engineering file of a holiday game. If the volume of the program package of the application program corresponding to each engineering file needs to be adjusted, each engineering file needs to be traversed, the configuration files in each engineering file are obtained, and then the configuration items to be modified in each configuration file are modified. For example, target files 1 to Target file n in fig. 5 are traversed, buildconconfigurations configuration files named Release in the Target files 1 to Target file n are obtained respectively, and n configuration files corresponding to the Target files 1 to Target file n are determined as configuration files corresponding to the project files.
In an alternative embodiment, the present embodiment may parse the file structure of the project file by using the xcodeprot frame, convert the project file into an xcodeprot object that can be identified by the xcodeprot frame, and the internal structure of the converted instance object may map the file structure of the introduced project file completely. The function description of the above-mentioned attribute may refer to the function of each file in the file structure description of the project file, which is not described herein.
In an alternative embodiment, referring to fig. 6, a prompt message for modifying the attribute value of the configuration item to be modified to a preset attribute value may be displayed in the operation interface 300, so that a user can intuitively know the modification progress of the configuration item to be modified.
Therefore, by describing the method provided by the embodiment, the user can detect the configuration item to be modified and modify the attribute value of the configuration item to be modified, which are related to the program package volume adjustment of the project file, only by performing the project file acquisition operation, so that the operation flow of the user when adjusting the program package volume is simplified, the interference of human factors in the program package adjustment process is reduced, the operation error rate is reduced, and the program package volume adjustment efficiency is improved.
In addition, the embodiment of the application only modifies the configuration items in the configuration files in the release mode, does not influence daily development of project files, can simultaneously modify a plurality of project files in one project file, does not need a user to manually modify the configuration items of each project file, and improves the adjustment efficiency of the volume of the program package.
Corresponding to the method for adjusting the volume of a package according to the first embodiment of the present application, the second embodiment of the present application further provides a device 700 for adjusting the volume of a package, as shown in fig. 7, which includes: an acquisition unit 701, a determination unit 702, a modification unit 703, and an adjustment unit 704;
The acquiring unit 701 is configured to receive an acquiring instruction of a project file of a package volume to be adjusted, and acquire the project file;
the determining unit 702 is configured to determine a configuration item to be modified corresponding to the project file and a current attribute value of the configuration item to be modified; the configuration item to be modified is used for adjusting the file content of the project file importing program package;
the modifying unit 703 is configured to modify the current attribute value of the configuration item to be modified to the preset attribute value if it is detected that the current attribute value of the configuration item to be modified is different from the preset attribute value of the configuration item to be modified;
the adjusting unit 704 is configured to adjust a package volume corresponding to the project file in a compiling process of the project file according to the configuration item to be modified having the preset attribute value.
Optionally, the determining unit 702 is specifically configured to obtain a configuration file corresponding to the project file; the configuration file is used for managing a plurality of configuration items required by compiling the project file; and determining the configuration item to be modified and the current attribute value of the configuration item to be modified in the plurality of configuration items.
Optionally, the determining unit 702 is specifically configured to obtain a file identifier of a configuration file corresponding to the project file; when the file identifier is detected to be the release version identifier, acquiring a configuration file corresponding to the release version identifier, and determining the configuration file corresponding to the release version identifier as the configuration file corresponding to the project file.
Optionally, the determining unit 702 is specifically further configured to obtain a preset configuration item identifier; querying a target configuration item corresponding to the preset configuration item identifier in the plurality of configuration items, and determining the target configuration item as the configuration item to be modified; and determining the current attribute value of the target configuration item as the current attribute value of the configuration item to be modified.
Optionally, the configuration item to be modified includes at least one of the following types of configuration items:
a first configuration item for adjusting the compiler optimization degree for compiling the project file;
a second configuration item for adjusting the size of the picture in the project file;
a third configuration item for adjusting a code or function in the project file;
and a fourth configuration item for adjusting a debugging symbol when the project file is debugged.
The adjusting unit 704 is specifically configured to enable, during compiling of the project file, the remaining optimization options except for the optimization option for adding the file content of the project file import package, and/or multiplex continuous machine instructions repeated in the project file by an external join function; the second configuration item with the second preset attribute value is used for compressing pictures in the project file according to a compression strategy corresponding to the third preset attribute value in the compiling process of the project file; the third preset attribute value of the third configuration item is used for adjusting the state of the third configuration item to be an on state, so that the third configuration item with the third preset attribute value is used for internalizing partial functions in the project file or removing redundant codes in the project file in the compiling process of the project file; the fourth preset attribute value of the fourth configuration item is used for adjusting the state of the fourth configuration item to be an on state, so that the fourth configuration item with the fourth preset attribute value removes redundant debugging symbols when compiling the project file in the compiling process of the project file.
Optionally, the apparatus 700 further comprises a display unit 705;
the display unit 705 is configured to display an operation interface for adjusting the package volume of the project file; the operation interface comprises a volume adjustment control; receiving a triggering instruction of the volume adjustment control in the operation interface, and displaying a file selection panel;
the obtaining unit 701 is specifically configured to obtain a project file in response to an instruction of selecting the project file with a package volume to be adjusted in the file selection panel.
Optionally, the display unit 705 is further configured to display, in the operation interface, a prompt message for modifying the attribute value of the configuration item to be modified to the preset attribute value.
Optionally, the determining unit 702 is specifically further configured to obtain an item description file in the item files; the project description file is used for storing configuration information required by compiling the project file; acquiring an engineering management file in the project description file; the project management file is used for managing at least one project file corresponding to the project file, and the project file is used for storing and generating a configuration file of the target application program; and acquiring the configuration file in the engineering file, and determining the configuration file in the engineering file as the configuration file corresponding to the project file.
Corresponding to the method for adjusting the volume of the package according to the first embodiment of the present application, the third embodiment of the present application further provides an electronic device for adjusting the volume of the package, as shown in fig. 8, where the electronic device includes: a processor 801; and a memory 802 for storing a program of the volume adjustment method of the package, the apparatus being powered on and executing the program of the volume adjustment method of the package by the processor, and executing the volume adjustment method steps of each package as provided in the first embodiment.
The fourth embodiment of the present application also provides a computer-readable storage medium storing a program of the volume adjustment method of the package, corresponding to the volume adjustment method of the package provided in the first embodiment of the present application, the program being executed by a processor to perform the volume adjustment method steps of the packages as provided in the first embodiment.
It should be noted that, for the detailed descriptions of the apparatus, the electronic device, and the computer readable storage medium provided in the second embodiment, the third embodiment, and the fourth embodiment of the present application, reference may be made to the related descriptions of the first embodiment of the present application, and the detailed descriptions are omitted here.
While the application has been described in terms of preferred embodiments, it is not intended to be limiting, but rather, it will be apparent to those skilled in the art that various changes and modifications can be made herein without departing from the spirit and scope of the application as defined by the appended claims.
In one typical configuration, a computing device of a blockchain node includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
1. Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable operations, data structures, modules of the program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
2. It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
While the application has been described in terms of preferred embodiments, it is not intended to be limiting, but rather, it will be apparent to those skilled in the art that various changes and modifications can be made herein without departing from the spirit and scope of the application as defined by the appended claims.

Claims (13)

1. A method for volume adjustment of a package, the method comprising:
receiving an acquisition instruction of a project file of which the volume is to be adjusted, and acquiring the project file;
determining a configuration item to be modified corresponding to the project file, and determining the current attribute value of the configuration item to be modified; the configuration item to be modified is used for adjusting the file content of the project file importing program package;
When detecting that the current attribute value of the configuration item to be modified is different from the preset attribute value of the configuration item to be modified, modifying the current attribute value into the preset attribute value;
and according to the configuration item to be modified with the preset attribute value, adjusting the corresponding program package volume of the project file in the compiling process of the project file.
2. The method according to claim 1, wherein the determining the configuration item to be modified corresponding to the project file and the current attribute value of the configuration item to be modified includes:
acquiring a configuration file corresponding to the project file; the configuration file is used for managing a plurality of configuration items required by compiling the project file;
and determining the configuration item to be modified and the current attribute value of the configuration item to be modified in the plurality of configuration items.
3. The method according to claim 2, wherein the obtaining the configuration file corresponding to the project file includes:
acquiring a file identifier of a configuration file corresponding to the project file;
when the file identifier is detected to be the release version identifier, acquiring a configuration file corresponding to the release version identifier, and determining the configuration file corresponding to the release version identifier as the configuration file corresponding to the project file.
4. The method of claim 2, wherein determining the configuration item to be modified and the current attribute value of the configuration item to be modified from the plurality of configuration items comprises:
acquiring a preset configuration item identifier;
querying a target configuration item corresponding to the preset configuration item identifier in the plurality of configuration items, and determining the target configuration item as the configuration item to be modified;
and determining the current attribute value of the target configuration item as the current attribute value of the configuration item to be modified.
5. The method according to claim 1, wherein the configuration item to be modified having the preset attribute value is used to reduce file contents of the project file importer package during compiling of the project file.
6. The method of claim 1, wherein the configuration items to be modified comprise at least one of the following types of configuration items:
a first configuration item for adjusting the compiler optimization degree for compiling the project file;
a second configuration item for adjusting the size of the picture in the project file;
a third configuration item for adjusting a code or function in the project file;
And a fourth configuration item for adjusting a debugging symbol when the project file is debugged.
7. The method of claim 6, wherein the first configuration item having a first preset attribute value is used to open remaining optimization options except for an optimization option to add file content of the project file import package during compiling of the project file, and/or to multiplex continuous machine instruction exception functions repeated in the project file;
the second configuration item with the second preset attribute value is used for compressing pictures in the project file according to a compression strategy corresponding to the third preset attribute value in the compiling process of the project file;
the third preset attribute value of the third configuration item is used for adjusting the state of the third configuration item to be an on state, so that the third configuration item with the third preset attribute value is used for internalizing partial functions in the project file or removing redundant codes in the project file in the compiling process of the project file;
the fourth preset attribute value of the fourth configuration item is used for adjusting the state of the fourth configuration item to be an on state, so that the fourth configuration item with the fourth preset attribute value removes redundant debugging symbols when compiling the project file in the compiling process of the project file.
8. The method according to claim 1, wherein the method further comprises:
displaying an operation interface for adjusting the package volume of the project file; the operation interface comprises a volume adjustment control;
the receiving an obtaining instruction of the project file of the program package volume to be adjusted, and obtaining the project file, includes:
receiving a triggering instruction of the volume adjustment control in the operation interface, and displaying a file selection panel;
and responding to an instruction for selecting the project file with the volume of the program package to be adjusted in the file selection panel, and acquiring the project file.
9. The method of claim 8, wherein the method further comprises:
and displaying prompt information for modifying the attribute value of the configuration item to be modified into the preset attribute value in the operation interface.
10. The method according to claim 2, wherein the obtaining the configuration file corresponding to the project file includes:
acquiring a project description file in the project file; the project description file is used for storing configuration information required by compiling the project file;
acquiring an engineering management file in the project description file; the project management file is used for managing at least one project file corresponding to the project file, and the project file is used for storing and generating a configuration file of the target application program;
And acquiring the configuration file in the engineering file, and determining the configuration file in the engineering file as the configuration file corresponding to the project file.
11. A device for adjusting the volume of a package, the device comprising: the device comprises an acquisition unit, a determination unit, a modification unit and an adjustment unit;
the acquisition unit is used for receiving an acquisition instruction of a project file of which the volume is to be adjusted, and acquiring the project file;
the determining unit is used for determining a configuration item to be modified corresponding to the project file and a current attribute value of the configuration item to be modified; the configuration item to be modified is used for adjusting the file content of the project file importing program package;
the modification unit is configured to modify the current attribute value to a preset attribute value when detecting that the current attribute value of the configuration item to be modified is different from the preset attribute value of the configuration item to be modified;
the adjusting unit is used for adjusting the volume of the program package corresponding to the project file in the compiling process of the project file according to the configuration item to be modified with the preset attribute value.
12. An electronic device, comprising:
A processor; and
a memory for storing a data processing program, the electronic device being powered on and executing the program by the processor, to perform the method of any one of claims 1 to 10.
13. A computer readable storage medium, characterized in that a data processing program is stored, which program is run by a processor, performing the method according to any of claims 1-10.
CN202310891559.7A 2023-07-19 2023-07-19 Program package volume adjustment method and device, electronic equipment and readable storage medium Pending CN117149252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310891559.7A CN117149252A (en) 2023-07-19 2023-07-19 Program package volume adjustment method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310891559.7A CN117149252A (en) 2023-07-19 2023-07-19 Program package volume adjustment method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117149252A true CN117149252A (en) 2023-12-01

Family

ID=88885722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310891559.7A Pending CN117149252A (en) 2023-07-19 2023-07-19 Program package volume adjustment method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117149252A (en)

Similar Documents

Publication Publication Date Title
US11741293B2 (en) Systems and methods of a script generation engine
US10990367B2 (en) Application development method, tool, and device, and storage medium
US8615750B1 (en) Optimizing application compiling
CN108628635A (en) Method, device, equipment and storage medium for acquiring parameter name and local variable name
US20030093420A1 (en) Method and system for retrieving sharable information using a hierarchically dependent directory structure
CN111240684B (en) Cutting method and device of JS codes, medium and electronic equipment
US20120110444A1 (en) Help Document Animated Visualization
CN110007920B (en) Method and device for acquiring code dependency relationship and electronic equipment
CN113553035A (en) Design and construction method of universal front-end UI component library
US7966600B2 (en) Distributed resource understanding tool management
CN112882718A (en) Compiling processing method, device, equipment and storage medium
CN110362317B (en) Code conversion method, device and storage medium
CN110020370B (en) Method and device for realizing animation in client application and framework of animation script
CN112818176B (en) Data processing method, device, equipment and storage medium
CN114217789A (en) Function component expansion method, device, equipment, storage medium and program product
CN117149252A (en) Program package volume adjustment method and device, electronic equipment and readable storage medium
US11442845B2 (en) Systems and methods for automatic test generation
CN114840195A (en) Privatization method for iOS SDK static library
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN112433816A (en) Performance optimization method and device based on Javascript engine
JP7059757B2 (en) API processing method, terminal, API processing program
CN111399931B (en) Method and terminal for exporting UI (user interface) resources by LayaAir engine
CN113971028B (en) Data processing method, apparatus, device, storage medium and computer program product
CN113821204B (en) Component generation method and device, electronic equipment and readable storage medium
Freeman et al. Understanding React Projects

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240311

Address after: Room 801901, building 5, No.16 Keyun Road, Tianhe District, Guangzhou City, Guangdong Province 510000

Applicant after: GUANGZHOU BOGUAN INFORMATION SCIENCE & TECHNOLOGY Co.,Ltd.

Country or region after: China

Address before: 310052 Building No. 599, Changhe Street Network Business Road, Binjiang District, Hangzhou City, Zhejiang Province, 4, 7 stories

Applicant before: NETEASE (HANGZHOU) NETWORK Co.,Ltd.

Country or region before: China