forked from uakihir0/SocialHub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
j2objc-apple.gradle
133 lines (111 loc) · 3.52 KB
/
j2objc-apple.gradle
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
130
131
132
133
buildscript {
repositories {
mavenCentral()
}
// dependencies {
// classpath files('j2objc-gradle-0.7.3.jar')
// }
}
plugins {
id 'java'
id 'idea'
id 'maven'
id 'net.socialhub.j2objccontrib.j2objcgradle' version '0.7.3'
}
apply plugin: 'net.socialhub.j2objccontrib.j2objcgradle'
group 'SocialHub'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.8.1'
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
mavenCentral()
}
}
dependencies {
// Translation Exclusion Library
implementation("com.google.code.findbugs:jsr305:${JSR_305_VERSION}")
// Common Library
compile("org.apache.commons:commons-lang3:${COMMONS_LANG_VERSION}")
compile("commons-codec:commons-codec:${COMMONS_CODEC_VERSION}")
compile("com.google.code.gson:gson:${GSON_VERSION}")
// J2ObjC Common Library
compile("com.github.uakihir0:JLogger:${JLOGGER_VERSION}")
compile("com.github.uakihir0:JHttpClient:${JHTTP_CLIENT_VERSION}")
compile("com.github.uakihir0:scribejava:${SCRIBE_VERSION}")
// J2ObjC Network Library
// Twitter
compile("com.github.uakihir0.twitter4j:twitter4j-core:${TWITTER4J_VERSION}")
compile("com.github.uakihir0.twitter4j:twitter4j-stream:${TWITTER4J_VERSION}")
compile("com.github.uakihir0:twitter-web-client:${TWITTER_WEB_VERSION}")
compile("com.github.uakihir0:twitter-text:${TWITTER_TEXT_VERSION}")
compile("com.github.uakihir0:jtw:${TWITTER_JTW_VERSION}")
// Other SNS
compile("com.github.uakihir0.facebook4j:facebook4j-core:${FACEBOOK4J_VERSION}")
compile("com.github.uakihir0.jslack:jslack-api-client:${JSLACK_VERSION}")
compile("com.github.uakihir0.jslack:jslack-api-model:${JSLACK_VERSION}")
compile("com.github.uakihir0:msinstance4j:${MSINSTANCEJ_VERSION}")
compile("com.github.uakihir0:mastodon4j:${MASTODON4J_VERSION}")
compile("com.github.uakihir0:jumblr:${JUMBLR_VERSION}")
compile("com.github.uakihir0:misskey4j:${MISSKEY4J_VERSION}")
// Test
testCompile("junit:junit:${JUNIT_VERSION}")
testImplementation("org.jsoup:jsoup:${JSOUP_VERSION}")
}
sourceSets {
test {
java {
srcDir 'src/test/java'
exclude '**/*.java'
}
}
}
j2objcConfig {
autoConfigureDeps true
skipJ2objcVerification true
// Only support 64bits
// TODO: 'ios_arm64e' should be support
supportedArchs = [
'ios_arm64',
'ios_sim_x86_64',
'ios_sim_arm64'
]
translateArgs '--build-closure'
translateArgs '--swift-friendly'
translateArgs '--prefixes', 'prefixes.properties'
extraObjcCompilerArgs '-fembed-bitcode'
extraLinkerArgs "-liconv"
finalConfigure()
}
j2objcTranslate.doLast {
exec {
executable "sh"
args './tool/buildheader.sh'
}
}
j2objcPodspec.doLast {
[getPodspecDebug(), getPodspecRelease()].asList().each {
String text = it.text
.replace(
"Pod::Spec.new do |spec|",
'''Pod::Spec.new do |spec|
spec.authors = 'Akihiro Urushihara'
spec.license = 'MIT'
spec.homepage = 'https://twitter.com/uakihir0'
spec.source = { :git => '[email protected]:uakihir0/SocialHub.git' }''')
.replace(
"icucore",
"icucore', 'iconv")
it.write(text)
}
}