Source Code Cross Referenced for P4Resolve.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:         * @ant.task category="scm"
030:         */
031:        public class P4Resolve extends P4Base {
032:            private String resolvemode = null;
033:
034:            private boolean redoall; /* -f */
035:            private boolean simulationmode; /* -n */
036:            private boolean forcetextmode; /* -t */
037:            private boolean markersforall; /* -v */
038:            private static final String AUTOMATIC = "automatic";
039:            private static final String FORCE = "force";
040:            private static final String SAFE = "safe";
041:            private static final String THEIRS = "theirs";
042:            private static final String YOURS = "yours";
043:            private static final String[] RESOLVE_MODES = { AUTOMATIC, FORCE,
044:                    SAFE, THEIRS, YOURS };
045:
046:            /**
047:             * returns the resolve mode
048:             * @return  returns the resolve mode
049:             */
050:            public String getResolvemode() {
051:                return resolvemode;
052:            }
053:
054:            /**
055:             * values for resolvemode
056:             * <ul>
057:             * <li> automatic -am</li>
058:             * <li> force -af </li>
059:             * <li> safe -as </li>
060:             * <li> theirs -at </li>
061:             * <li> yours -ay </li>
062:             * </ul>
063:             * @param resolvemode one of automatic, force, safe, theirs, yours
064:             */
065:            public void setResolvemode(String resolvemode) {
066:                boolean found = false;
067:                for (int counter = 0; counter < RESOLVE_MODES.length; counter++) {
068:                    if (resolvemode.equals(RESOLVE_MODES[counter])) {
069:                        found = true;
070:                        break;
071:                    }
072:                }
073:                if (!found) {
074:                    throw new BuildException(
075:                            "Unacceptable value for resolve mode");
076:                }
077:                this .resolvemode = resolvemode;
078:            }
079:
080:            /**
081:             * allows previously resolved files to be resolved again
082:             * @return flag indicating whether one wants to
083:             * allow previously resolved files to be resolved again
084:             */
085:            public boolean isRedoall() {
086:                return redoall;
087:            }
088:
089:            /**
090:             * set the redoall flag
091:             * @param redoall flag indicating whether one want to
092:             * allow previously resolved files to be resolved again
093:             */
094:            public void setRedoall(boolean redoall) {
095:                this .redoall = redoall;
096:            }
097:
098:            /**
099:             * read the simulation mode flag
100:             * @return flag indicating whether one wants just to simulate
101:             * the p4 resolve operation whithout actually doing it
102:             */
103:            public boolean isSimulationmode() {
104:                return simulationmode;
105:            }
106:
107:            /**
108:             * sets a flag
109:             * @param simulationmode set to true, lists the integrations which would be performed,
110:             * without actually doing them.
111:             */
112:            public void setSimulationmode(boolean simulationmode) {
113:                this .simulationmode = simulationmode;
114:            }
115:
116:            /**
117:             * If set to true, attempts a textual merge, even for binary files
118:             * @return flag value
119:             */
120:            public boolean isForcetextmode() {
121:                return forcetextmode;
122:            }
123:
124:            /**
125:             * If set to true, attempts a textual merge, even for binary files
126:             * @param forcetextmode set the flag value
127:             */
128:            public void setForcetextmode(boolean forcetextmode) {
129:                this .forcetextmode = forcetextmode;
130:            }
131:
132:            /**
133:             * If set to true, puts in markers for all changes, conflicting or not
134:             * @return  flag markersforall value
135:             */
136:            public boolean isMarkersforall() {
137:                return markersforall;
138:            }
139:
140:            /**
141:             * If set to true, puts in markers for all changes, conflicting or not
142:             * @param markersforall flag true or false
143:             */
144:            public void setMarkersforall(boolean markersforall) {
145:                this .markersforall = markersforall;
146:            }
147:
148:            /**
149:             *  execute the p4 resolve
150:             * @throws BuildException if there is a wrong resolve mode specified
151:             *  or no view specified
152:             */
153:            public void execute() throws BuildException {
154:                if (this .resolvemode.equals(AUTOMATIC)) {
155:                    P4CmdOpts = P4CmdOpts + " -am";
156:                } else if (this .resolvemode.equals(FORCE)) {
157:                    P4CmdOpts = P4CmdOpts + " -af";
158:                } else if (this .resolvemode.equals(SAFE)) {
159:                    P4CmdOpts = P4CmdOpts + " -as";
160:                } else if (this .resolvemode.equals(THEIRS)) {
161:                    P4CmdOpts = P4CmdOpts + " -at";
162:                } else if (this .resolvemode.equals(YOURS)) {
163:                    P4CmdOpts = P4CmdOpts + " -ay";
164:                } else {
165:                    throw new BuildException(
166:                            "unsupported or absent resolve mode");
167:                }
168:                if (P4View == null) {
169:                    throw new BuildException("please specify a view");
170:                }
171:                if (this .isRedoall()) {
172:                    P4CmdOpts = P4CmdOpts + " -f";
173:                }
174:                if (this .isSimulationmode()) {
175:                    P4CmdOpts = P4CmdOpts + " -n";
176:                }
177:                if (this .isForcetextmode()) {
178:                    P4CmdOpts = P4CmdOpts + " -t";
179:                }
180:                if (this .isMarkersforall()) {
181:                    P4CmdOpts = P4CmdOpts + " -v";
182:                }
183:                execP4Command("-s resolve " + P4CmdOpts + " " + P4View,
184:                        new SimpleP4OutputHandler(this));
185:            }
186:        }
w___ww__.__j_a__v___a2___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.