-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
73 lines (61 loc) · 2.99 KB
/
build.xml
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
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="redpen-intellij-plugin" default="all.with.deps">
<property name="ivy.version" value="2.4.0"/>
<target name="deps" depends="install-ivy">
<delete dir="lib/default"/>
<delete dir="lib/test"/>
<ivy:retrieve pattern="lib/[conf]/[artifact]-[type]-[revision].[ext]" symlink="true"/>
</target>
<target name="install-ivy">
<mkdir dir="lib"/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" dest="lib/ivy.jar" usetimestamp="true"/>
<path id="ivy.lib.path">
<fileset dir="lib" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="download-idea">
<delete dir="idea" failonerror="false"/>
<get src="https://data.services.jetbrains.com/products/releases?code=IIC&latest=true&type=release" dest="idea-release.json"/>
<replaceregexp file="idea-release.json" match="^(.*)$" replace="project.setProperty('idea-link', (\1).IIC[0].downloads.linux.link)"/>
<script language="javascript" src="idea-release.json"/>
<get src="${idea-link}" dest="idea.tar.gz"/>
<untar src="idea.tar.gz" dest="." compression="gzip">
<patternset includes="idea-*/bin/*"/>
<patternset includes="idea-*/lib/*.jar"/>
<patternset includes="idea-*/plugins/Kotlin/**/*.jar"/>
</untar>
<dirset id="idea-dir" dir="." includes="idea-IC-*"/>
<property name="idea-dir" refid="idea-dir"/>
<move file="${idea-dir}" tofile="idea"/>
<delete file="idea-release.json"/>
<delete file="idea.tar.gz"/>
</target>
<property environment="env"/>
<target name="check-publish">
<exec command="git rev-parse --abbrev-ref HEAD" outputproperty="git.branch"/>
<condition property="should-publish">
<and>
<not><equals arg1="${env.TRAVIS_PULL_REQUEST}" arg2="true"/></not>
<or>
<equals arg1="${env.TRAVIS_BRANCH}" arg2="master"/>
<equals arg1="${git.branch}" arg2="master"/>
</or>
</and>
</condition>
</target>
<target name="publish" if="should-publish" depends="check-publish">
<echo message="Publishing plugin to JetBrains repository using username from $JETBRAINS_USER (${env.JETBRAINS_USER}) and password from $JETBRAINS_PWD"/>
<exec dir="." executable="curl" failonerror="true">
<arg line="-s"/>
<arg line="-o publish-result.html"/>
<arg line="-F [email protected]"/>
<arg line="-F pluginId=8210"/>
<arg line="-F userName=${env.JETBRAINS_USER}"/>
<arg line="-F password=${env.JETBRAINS_PWD}"/>
<arg line="https://plugins.jetbrains.com/plugin/uploadPlugin"/>
</exec>
<echo message="Please examine publish-result.html for details if it was successful. Publish normally succeeds only if version number has changed."/>
</target>
<import file="redpen-intellij-plugin.xml"/>
<target name="all.with.deps" depends="deps,all"/>
</project>