@@ -99,8 +99,74 @@ android {
9999 }
100100 }
101101
102+ tasks.register<Exec >(" rustupTargetAddAarch64LinuxAndroid" ) {
103+ onlyIf {
104+ try {
105+ val result = exec {
106+ isIgnoreExitValue = true
107+ commandLine(" rustup" , " -V" )
108+ }
109+ result.exitValue != 0
110+ } catch (e: Exception ) {
111+ return @onlyIf false
112+ }
113+ }
114+ commandLine(" rustup" , " target" , " add" , " aarch64-linux-android" )
115+ }
116+
117+ tasks.register<Exec >(" rustupTargetAddArmv7LinuxAndroideabi" ) {
118+ onlyIf {
119+ try {
120+ val result = exec {
121+ isIgnoreExitValue = true
122+ commandLine(" rustup" , " -V" )
123+ }
124+ result.exitValue != 0
125+ } catch (e: Exception ) {
126+ return @onlyIf false
127+ }
128+ }
129+ commandLine(" rustup" , " target" , " add" , " armv7-linux-androideabi" )
130+ }
131+
132+ tasks.register<Exec >(" rustupTargetAddI686LinuxAndroid" ) {
133+ onlyIf {
134+ try {
135+ val result = exec {
136+ isIgnoreExitValue = true
137+ commandLine(" rustup" , " -V" )
138+ }
139+ result.exitValue != 0
140+ } catch (e: Exception ) {
141+ return @onlyIf false
142+ }
143+ }
144+ commandLine(" rustup" , " target" , " add" , " i686-linux-android" )
145+ }
146+
147+ tasks.register<Exec >(" rustupTargetAddX64LinuxAndroid" ) {
148+ onlyIf {
149+ try {
150+ val result = exec {
151+ isIgnoreExitValue = true
152+ commandLine(" rustup" , " -V" )
153+ }
154+ result.exitValue != 0
155+ } catch (e: Exception ) {
156+ return @onlyIf false
157+ }
158+ }
159+ commandLine(" rustup" , " target" , " add" , " x86_64-linux-android" )
160+ }
161+
102162 tasks.preBuild {
103- dependsOn(" copyChewingDataFiles" )
163+ dependsOn(
164+ " copyChewingDataFiles" ,
165+ " rustupTargetAddAarch64LinuxAndroid" ,
166+ " rustupTargetAddArmv7LinuxAndroideabi" ,
167+ " rustupTargetAddI686LinuxAndroid" ,
168+ " rustupTargetAddX64LinuxAndroid"
169+ )
104170 }
105171
106172 tasks.register<Delete >(" cleanChewingDataFiles" ) {
0 commit comments