|
92 | 92 | <artifactId>maven-compiler-plugin</artifactId> |
93 | 93 | <version>3.14.1</version> |
94 | 94 | </plugin> |
95 | | - <!-- Copy image.png to site resources directory --> |
| 95 | + <!-- Clone or update the official copilot-sdk repository for test resources, and copy image to site --> |
96 | 96 | <plugin> |
97 | 97 | <groupId>org.apache.maven.plugins</groupId> |
98 | 98 | <artifactId>maven-antrun-plugin</artifactId> |
99 | | - <version>3.1.0</version> |
| 99 | + <version>3.2.0</version> |
100 | 100 | <executions> |
| 101 | + <execution> |
| 102 | + <id>clone-or-update-copilot-sdk</id> |
| 103 | + <phase>generate-test-resources</phase> |
| 104 | + <goals> |
| 105 | + <goal>run</goal> |
| 106 | + </goals> |
| 107 | + <configuration> |
| 108 | + <target xmlns:if="ant:if" xmlns:unless="ant:unless"> |
| 109 | + <!-- Check if .git directory exists --> |
| 110 | + <condition property="repo.exists"> |
| 111 | + <available file="${copilot.sdk.clone.dir}/.git" type="dir" /> |
| 112 | + </condition> |
| 113 | + |
| 114 | + <!-- If repo exists, fetch and reset --> |
| 115 | + <sequential if:set="repo.exists"> |
| 116 | + <echo message="Updating existing copilot-sdk repository..." /> |
| 117 | + <exec executable="git" dir="${copilot.sdk.clone.dir}" failonerror="true"> |
| 118 | + <arg value="fetch" /> |
| 119 | + <arg value="origin" /> |
| 120 | + </exec> |
| 121 | + <exec executable="git" dir="${copilot.sdk.clone.dir}" failonerror="true"> |
| 122 | + <arg value="reset" /> |
| 123 | + <arg value="--hard" /> |
| 124 | + <arg value="origin/main" /> |
| 125 | + </exec> |
| 126 | + </sequential> |
| 127 | + |
| 128 | + <!-- If repo doesn't exist, clone it --> |
| 129 | + <sequential unless:set="repo.exists"> |
| 130 | + <echo message="Cloning copilot-sdk repository..." /> |
| 131 | + <delete dir="${copilot.sdk.clone.dir}" quiet="true" /> |
| 132 | + <exec executable="git" failonerror="true"> |
| 133 | + <arg value="clone" /> |
| 134 | + <arg value="--depth" /> |
| 135 | + <arg value="1" /> |
| 136 | + <arg value="https://github.com/github/copilot-sdk.git" /> |
| 137 | + <arg value="${copilot.sdk.clone.dir}" /> |
| 138 | + </exec> |
| 139 | + </sequential> |
| 140 | + </target> |
| 141 | + </configuration> |
| 142 | + </execution> |
101 | 143 | <execution> |
102 | 144 | <id>copy-image-to-site</id> |
103 | 145 | <phase>pre-site</phase> |
|
111 | 153 | </configuration> |
112 | 154 | </execution> |
113 | 155 | </executions> |
| 156 | + <dependencies> |
| 157 | + <!-- Required for if:set and unless:set --> |
| 158 | + <dependency> |
| 159 | + <groupId>org.apache.ant</groupId> |
| 160 | + <artifactId>ant</artifactId> |
| 161 | + <version>1.10.15</version> |
| 162 | + </dependency> |
| 163 | + </dependencies> |
114 | 164 | </plugin> |
115 | | - <!-- Clone the official copilot-sdk repository for test resources --> |
| 165 | + <!-- Install harness dependencies --> |
116 | 166 | <plugin> |
117 | 167 | <groupId>org.codehaus.mojo</groupId> |
118 | 168 | <artifactId>exec-maven-plugin</artifactId> |
119 | 169 | <version>3.6.2</version> |
120 | 170 | <executions> |
121 | | - <execution> |
122 | | - <id>clone-copilot-sdk</id> |
123 | | - <phase>generate-test-resources</phase> |
124 | | - <goals> |
125 | | - <goal>exec</goal> |
126 | | - </goals> |
127 | | - <configuration> |
128 | | - <executable>git</executable> |
129 | | - <arguments> |
130 | | - <argument>clone</argument> |
131 | | - <argument>--depth</argument> |
132 | | - <argument>1</argument> |
133 | | - <argument>https://github.com/github/copilot-sdk.git</argument> |
134 | | - <argument>${copilot.sdk.clone.dir}</argument> |
135 | | - </arguments> |
136 | | - <successCodes> |
137 | | - <successCode>0</successCode> |
138 | | - <successCode>128</successCode> <!-- Already exists --> |
139 | | - </successCodes> |
140 | | - </configuration> |
141 | | - </execution> |
142 | 171 | <execution> |
143 | 172 | <id>install-harness-dependencies</id> |
144 | 173 | <phase>generate-test-resources</phase> |
|
0 commit comments