-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmigrate.xml
More file actions
129 lines (107 loc) · 5.08 KB
/
migrate.xml
File metadata and controls
129 lines (107 loc) · 5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?xml version="1.0" encoding="UTF-8"?>
<project name="MigrateContacts" default="generateContract" >
<!-- Allow user specific configuration -->
<property file="${user.home}/.${ant.project.name}.properties" />
<property file="${user.home}/.build.properties" />
<!--
C O N F I G U R A T I O N
Migrate properties can be specified by editing this file (NOT recommended),
in migrate.properties, or on the command line.
There is a copy of a typical migrate.properties file in the tools
directory (./tools). Copy it to the project root and modify it as necessary,
to suit your system. When you have it set up, type:
$ ant -f migrate.xml
... to build the Contract file in the gen directory
To specify the necessary properties on the command line use the -D flag
$ ant -Dmigrate.sdk.root=../../migrate-sdk ...
You may supply as many -D flags as you like. They override values defined
in the migrate.properties file.
-->
<property file="${basedir}/migrate.properties" />
<!-- The location of the Migrate SDK: specify in migrate.properties -->
<property name="migrate.sdk.root" value="" />
<!-- The endpoint for the Migrate Service -->
<property name="migrate.endpoint" value="" />
<!-- The fqn for the class that defines the migrate schema: specify in migrate.properties -->
<property name="migrate.object" value="" />
<!-- The root of the directory containing the template interface: specify in migrate.properties -->
<property name="migrate.class.root" value="bin/classes/" />
<!-- The directory into which the Contract file will be put -->
<property name="migrate.gen.root" value="gen" />
<property name="migrate.username" value="" />
<property name="migrate.password" value="" />
<!-- END OF USER CONFIGURATION SECTION -->
<!-- check on migrate.sdk.root -->
<fail message="Can't find the Migrate SDK (${migrate.sdk.root}). Please set the property migrate.sdk.root to point at the root of the migrate SDK">
<condition>
<not>
<resourceexists>
<file file="${migrate.sdk.root}" />
</resourceexists>
</not>
</condition>
</fail>
<import file="${migrate.sdk.root}/migrate-sdk.xml" />
<!-- check on migrate.class.root -->
<fail message="Can't find the java class directory (${migrate.class.root}). Please set the property migrate.class.root to point at the root of java compiler output">
<condition>
<not>
<resourceexists>
<file file="${migrate.class.root}" />
</resourceexists>
</not>
</condition>
</fail>
<!-- check on migrate.gen.root -->
<fail message="Can't find the generated java directory (${migrate.gen.root}). Please set the property migrate.gen.root to point at the android 'gen' directory">
<condition>
<not>
<resourceexists>
<file file="${migrate.gen.root}" />
</resourceexists>
</not>
</condition>
</fail>
<!-- check on migrate.username -->
<fail message="Please supply basic auth migrate.username for posting schema to a migrate instance.">
<condition>
<or>
<equals arg1="${migrate.username}" arg2=""/>
<not>
<isset property="migrate.username"/>
</not>
</or>
</condition>
</fail>
<!-- check on migrate.password -->
<fail message="Please supply basic auth migrate.password for posting schema to a migrate instance.">
<condition>
<or>
<equals arg1="${migrate.password}" arg2=""/>
<not>
<isset property="migrate.password"/>
</not>
</or>
</condition>
</fail>
<target name="generateContract"
description="Generate the ContentProvider contract">
<echo>Generating Contract for ${migrate.object} from ${migrate.class.root} to ${migrate.gen.root}</echo>
<antcall target="sdk.generateContract">
<param name="contract.classpath" value="${migrate.class.root}" />
<param name="contract.apis" value="${migrate.object}" />
<param name="destinationDirectory" value="${migrate.gen.root}" />
<param name="migrateUsername" value="${migrate.username}" />
<param name="migratePassword" value="${migrate.password}" />
</antcall>
</target>
<target name="postSchema" description="Post a schema to remote migrate service">
<antcall target="sdk.postSchema">
<param name="contract.classpath" value="${migrate.class.root}" />
<param name="contract.apis" value="${migrate.object}" />
<param name="migrateURL" value="${migrate.endpoint}" />
<param name="migrateUsername" value="${migrate.username}" />
<param name="migratePassword" value="${migrate.password}" />
</antcall>
</target>
</project>