1
|
|
<?php
|
2
|
|
/**
|
3
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
4
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
5
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
6
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
7
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
8
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
9
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
10
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
11
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
12
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
13
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
|
|
*
|
15
|
|
* This software consists of voluntary contributions made by many individuals
|
16
|
|
* and is licensed under the LGPL. For more information please see
|
17
|
|
* <http://phing.info>.
|
18
|
|
*/
|
19
|
|
|
20
|
|
/**
|
21
|
|
* List all properties on files, dirs, or revisions from the working copy
|
22
|
|
*/
|
23
|
|
class SvnPropgetTask extends SvnBaseTask
|
24
|
|
{
|
25
|
|
private $fromDir;
|
26
|
|
private $svnPropertyName;
|
27
|
|
private $propertyName = "svn.propget";
|
28
|
|
|
29
|
|
/**
|
30
|
|
* Sets the name of the property to use
|
31
|
|
*
|
32
|
|
* @param $propertyName
|
33
|
|
*/
|
34
|
0
|
public function setPropertyName($propertyName)
|
35
|
|
{
|
36
|
0
|
$this->propertyName = $propertyName;
|
37
|
|
}
|
38
|
|
|
39
|
|
/**
|
40
|
|
* Returns the name of the property to use
|
41
|
|
*/
|
42
|
0
|
public function getPropertyName()
|
43
|
|
{
|
44
|
0
|
return $this->propertyName;
|
45
|
|
}
|
46
|
|
|
47
|
|
/**
|
48
|
|
* Sets the name of the property to use
|
49
|
|
*
|
50
|
|
* @param $fromDir
|
51
|
|
*/
|
52
|
0
|
public function setFromDir($fromDir)
|
53
|
|
{
|
54
|
0
|
$this->fromDir = $fromDir;
|
55
|
|
}
|
56
|
|
|
57
|
|
/**
|
58
|
|
* Returns the name of the property to use
|
59
|
|
*/
|
60
|
0
|
public function getFromDir()
|
61
|
|
{
|
62
|
0
|
return $this->fromDir;
|
63
|
|
}
|
64
|
|
|
65
|
|
/**
|
66
|
|
* Sets the name of the property to use
|
67
|
|
*
|
68
|
|
* @param $svnPropertyName
|
69
|
|
*/
|
70
|
0
|
public function setSvnPropertyName($svnPropertyName)
|
71
|
|
{
|
72
|
0
|
$this->svnPropertyName = $svnPropertyName;
|
73
|
|
}
|
74
|
|
|
75
|
|
/**
|
76
|
|
* Returns the name of the property to use
|
77
|
|
*/
|
78
|
0
|
public function getSvnPropertyName()
|
79
|
|
{
|
80
|
0
|
return $this->svnPropertyName;
|
81
|
|
}
|
82
|
|
|
83
|
|
/**
|
84
|
|
* The main entry point
|
85
|
|
*
|
86
|
|
* @throws BuildException
|
87
|
|
*/
|
88
|
0
|
public function main()
|
89
|
|
{
|
90
|
0
|
$this->setup('propget');
|
91
|
|
|
92
|
0
|
$this->log("Get value from file '" . $this->getWorkingCopy() . "'");
|
93
|
|
|
94
|
0
|
$output = $this->run([$this->getSvnPropertyName(), $this->getFromDir()]);
|
95
|
|
|
96
|
0
|
$this->project->setProperty($this->getPropertyName(), $output);
|
97
|
|
}
|
98
|
|
}
|