Source Code Cross Referenced for P4Integrate.java in  » Build » ANT » org » apache » tools » ant » taskdefs » optional » perforce » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant.taskdefs.optional.perforce 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         *
017:         */
018:        /*
019:         * Portions of this software are based upon public domain software
020:         * originally written at the National Center for Supercomputing Applications,
021:         * University of Illinois, Urbana-Champaign.
022:         */
023:
024:        package org.apache.tools.ant.taskdefs.optional.perforce;
025:
026:        import org.apache.tools.ant.BuildException;
027:
028:        /**
029:         * Integrate file(s).
030:         * P4Change should be used to obtain a new changelist for P4Integrate,
031:         * although P4Integrate can open files to the default change,
032:         * P4Submit cannot yet submit to it.
033:         * Example Usage:<br>
034:         * &lt;p4integrate change="${p4.change}"
035:         * fromfile="//depot/project/dev/foo.txt" tofile="//depot/project/main/foo.txt" /&gt;
036:         *
037:         *
038:         * @ant.task category="scm"
039:         */
040:
041:        public class P4Integrate extends P4Base {
042:
043:            private String change = null;
044:            private String fromfile = null;
045:            private String tofile = null;
046:            private String branch = null;
047:            private boolean restoredeletedrevisions = false;
048:            private boolean forceintegrate = false;
049:            private boolean leavetargetrevision = false;
050:            private boolean enablebaselessmerges = false;
051:            private boolean simulationmode = false;
052:            private boolean reversebranchmappings = false;
053:            private boolean propagatesourcefiletype = false;
054:            private boolean nocopynewtargetfiles = false;
055:
056:            /**
057:             * get the changelist number
058:             *
059:             * @return the changelist number set for this task
060:             */
061:            public String getChange() {
062:                return change;
063:            }
064:
065:            /**
066:             * set the changelist number for the operation
067:             *
068:             * @param change An existing changelist number to assign files to; optional
069:             * but strongly recommended.
070:             */
071:            public void setChange(String change) {
072:                this .change = change;
073:            }
074:
075:            /**
076:             * get the from file specification
077:             *
078:             * @return the from file specification
079:             */
080:            public String getFromfile() {
081:                return fromfile;
082:            }
083:
084:            /**
085:             * sets the from file specification
086:             *
087:             * @param fromf the from file specification
088:             */
089:            public void setFromfile(String fromf) {
090:                this .fromfile = fromf;
091:            }
092:
093:            /**
094:             * get the to file specification
095:             *
096:             * @return the to file specification
097:             */
098:            public String getTofile() {
099:                return tofile;
100:            }
101:
102:            /**
103:             * sets the to file specification
104:             *
105:             * @param tof the to file specification
106:             */
107:            public void setTofile(String tof) {
108:                this .tofile = tof;
109:            }
110:
111:            /**
112:             * get the branch
113:             *
114:             * @return the name of the branch
115:             */
116:            public String getBranch() {
117:                return branch;
118:            }
119:
120:            /**
121:             * sets the branch
122:             *
123:             * @param br the name of the branch to use
124:             */
125:            public void setBranch(String br) {
126:                this .branch = br;
127:            }
128:
129:            /**
130:             * gets the restoredeletedrevisions flag
131:             *
132:             * @return restore deleted revisions
133:             */
134:            public boolean isRestoreDeletedRevisions() {
135:                return restoredeletedrevisions;
136:            }
137:
138:            /**
139:             * sets the restoredeletedrevisions flag
140:             *
141:             * @param setrest value chosen for restoredeletedrevisions
142:             */
143:            public void setRestoreDeletedRevisions(boolean setrest) {
144:                this .restoredeletedrevisions = setrest;
145:            }
146:
147:            /**
148:             * gets the forceintegrate flag
149:             *
150:             * @return restore deleted revisions
151:             */
152:            public boolean isForceIntegrate() {
153:                return forceintegrate;
154:            }
155:
156:            /**
157:             * sets the forceintegrate flag
158:             *
159:             * @param setrest value chosen for forceintegrate
160:             */
161:            public void setForceIntegrate(boolean setrest) {
162:                this .forceintegrate = setrest;
163:            }
164:
165:            /**
166:             * gets the leavetargetrevision flag
167:             *
168:             * @return flag indicating if the target revision should be preserved
169:             */
170:            public boolean isLeaveTargetRevision() {
171:                return leavetargetrevision;
172:            }
173:
174:            /**
175:             * sets the leavetargetrevision flag
176:             *
177:             * @param setrest value chosen for leavetargetrevision
178:             */
179:            public void setLeaveTargetRevision(boolean setrest) {
180:                this .leavetargetrevision = setrest;
181:            }
182:
183:            /**
184:             * gets the enablebaselessmerges flag
185:             *
186:             * @return boolean indicating if baseless merges are desired
187:             */
188:            public boolean isEnableBaselessMerges() {
189:                return enablebaselessmerges;
190:            }
191:
192:            /**
193:             * sets the enablebaselessmerges flag
194:             *
195:             * @param setrest value chosen for enablebaselessmerges
196:             */
197:            public void setEnableBaselessMerges(boolean setrest) {
198:                this .enablebaselessmerges = setrest;
199:            }
200:
201:            /**
202:             * gets the simulationmode flag
203:             *
204:             * @return simulation mode flag
205:             */
206:            public boolean isSimulationMode() {
207:                return simulationmode;
208:            }
209:
210:            /**
211:             * sets the simulationmode flag
212:             *
213:             * @param setrest value chosen for simulationmode
214:             */
215:            public void setSimulationMode(boolean setrest) {
216:                this .simulationmode = setrest;
217:            }
218:
219:            /**
220:             * returns the flag indicating if reverse branch mappings are sought
221:             *
222:             * @return reversebranchmappings flag
223:             */
224:            public boolean isReversebranchmappings() {
225:                return reversebranchmappings;
226:            }
227:
228:            /**
229:             *  sets the reversebranchmappings flag
230:             *
231:             *  @param reversebranchmappings flag indicating if reverse branch mappings are sought
232:             */
233:            public void setReversebranchmappings(boolean reversebranchmappings) {
234:                this .reversebranchmappings = reversebranchmappings;
235:            }
236:
237:            /**
238:             *  returns flag indicating if propagation of source file type is sought
239:             *
240:             *  @return flag set to true if you want to propagate source file type for existing target files
241:             */
242:            public boolean isPropagatesourcefiletype() {
243:                return propagatesourcefiletype;
244:            }
245:
246:            /**
247:             *   sets flag indicating if one wants to propagate the source file type
248:             *
249:             *   @param propagatesourcefiletype
250:             *   set it to true if you want to change the type of existing target files
251:             *   according to type of source file.
252:             */
253:            public void setPropagatesourcefiletype(
254:                    boolean propagatesourcefiletype) {
255:                this .propagatesourcefiletype = propagatesourcefiletype;
256:            }
257:
258:            /**
259:             *   indicates intention to suppress the copying on the local hard disk of new target files.
260:             *
261:             *   @return indicates intention to suppress the copying
262:             *   on the local hard disk of new target files.
263:             */
264:            public boolean isNocopynewtargetfiles() {
265:                return nocopynewtargetfiles;
266:            }
267:
268:            /**
269:             *   sets nocopynewtargetfiles flag
270:             *
271:             *   @param nocopynewtargetfiles set it to true to gain speed in integration by not copying on
272:             *   the local Perforce client new target files
273:             */
274:            public void setNocopynewtargetfiles(boolean nocopynewtargetfiles) {
275:                this .nocopynewtargetfiles = nocopynewtargetfiles;
276:            }
277:
278:            /**
279:             *  execute the p4 integrate
280:             *  @throws BuildException if there are missing parameters
281:             */
282:            public void execute() throws BuildException {
283:                if (change != null) {
284:                    P4CmdOpts = "-c " + change;
285:                }
286:                if (this .forceintegrate) {
287:                    P4CmdOpts = P4CmdOpts + " -f";
288:                }
289:                if (this .restoredeletedrevisions) {
290:                    P4CmdOpts = P4CmdOpts + " -d";
291:                }
292:                if (this .leavetargetrevision) {
293:                    P4CmdOpts = P4CmdOpts + " -h";
294:                }
295:                if (this .enablebaselessmerges) {
296:                    P4CmdOpts = P4CmdOpts + " -i";
297:                }
298:                if (this .simulationmode) {
299:                    P4CmdOpts = P4CmdOpts + " -n";
300:                }
301:                if (this .reversebranchmappings) {
302:                    P4CmdOpts = P4CmdOpts + " -r";
303:                }
304:                if (this .propagatesourcefiletype) {
305:                    P4CmdOpts = P4CmdOpts + " -t";
306:                }
307:                if (this .nocopynewtargetfiles) {
308:                    P4CmdOpts = P4CmdOpts + "-v";
309:                }
310:                String command;
311:                if (branch == null && fromfile != null && tofile != null) {
312:                    command = P4CmdOpts + " " + fromfile + " " + tofile;
313:                } else if (branch != null && fromfile == null && tofile != null) {
314:                    command = P4CmdOpts + " -b " + branch + " " + tofile;
315:                } else if (branch != null && fromfile != null) {
316:                    command = P4CmdOpts + " -b " + branch + " -s " + fromfile
317:                            + " " + tofile;
318:                } else {
319:                    throw new BuildException(
320:                            "you need to specify fromfile and tofile, "
321:                                    + "or branch and tofile, or branch and fromfile, or branch and fromfile and tofile ");
322:                }
323:                execP4Command("-s integrate " + command,
324:                        new SimpleP4OutputHandler(this));
325:            }
326:        }
w__w___w___.__j__a___v__a___2__s.___c__o__m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.