Skip to content

Commit 6a119a9

Browse files
authored
Merge pull request #1050 from wordpress-mobile/build/enable-non-transitive-resources
[Build] Enable Non-Transitive Resources
2 parents b1f600a + f2dcd9c commit 6a119a9

File tree

5 files changed

+39
-32
lines changed

5 files changed

+39
-32
lines changed

app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditLinkPage.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import androidx.test.espresso.assertion.ViewAssertions
99
import androidx.test.espresso.matcher.ViewMatchers.withId
1010
import androidx.test.espresso.matcher.ViewMatchers.withText
1111
import org.wordpress.aztec.demo.BasePage
12-
import org.wordpress.aztec.demo.R
12+
import org.wordpress.aztec.R as AztecR
1313

1414
class EditLinkPage : BasePage() {
1515

@@ -24,9 +24,9 @@ class EditLinkPage : BasePage() {
2424
get() = onView(withText("Insert link"))
2525

2626
init {
27-
urlField = onView(withId(R.id.linkURL))
28-
nameField = onView(withId(R.id.linkText))
29-
openInNewWindowCheckbox = onView(withId(R.id.openInNewWindow))
27+
urlField = onView(withId(AztecR.id.linkURL))
28+
nameField = onView(withId(AztecR.id.linkText))
29+
openInNewWindowCheckbox = onView(withId(AztecR.id.openInNewWindow))
3030
okButton = onView(withId(android.R.id.button1))
3131
cancelButton = onView(withId(android.R.id.button2))
3232
removeButton = onView(withId(android.R.id.button3))

app/src/androidTest/kotlin/org/wordpress/aztec/demo/pages/EditorPage.kt

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.wordpress.aztec.demo.pages
22

3+
import android.view.KeyEvent
4+
import android.view.View
35
import androidx.test.espresso.DataInteraction
46
import androidx.test.espresso.Espresso.onData
57
import androidx.test.espresso.Espresso.onView
@@ -12,8 +14,6 @@ import androidx.test.espresso.action.ViewActions.typeTextIntoFocusedView
1214
import androidx.test.espresso.assertion.ViewAssertions.matches
1315
import androidx.test.espresso.matcher.ViewMatchers.withId
1416
import androidx.test.espresso.matcher.ViewMatchers.withText
15-
import android.view.KeyEvent
16-
import android.view.View
1717
import org.hamcrest.Matcher
1818
import org.hamcrest.Matchers.allOf
1919
import org.hamcrest.Matchers.hasToString
@@ -22,6 +22,8 @@ import org.wordpress.aztec.demo.Actions
2222
import org.wordpress.aztec.demo.BasePage
2323
import org.wordpress.aztec.demo.Matchers
2424
import org.wordpress.aztec.demo.R
25+
import org.wordpress.aztec.R as AztecR
26+
import org.wordpress.aztec.plugins.wpcomments.R as WPCommentsR
2527

2628
class EditorPage : BasePage() {
2729
private var editor: ViewInteraction
@@ -58,20 +60,20 @@ class EditorPage : BasePage() {
5860
undoButton = onView(withId(R.id.undo))
5961
redoButton = onView(withId(R.id.redo))
6062

61-
openMediaToolbarButton = onView(withId(R.id.format_bar_button_media_collapsed))
62-
closeMediaToolbarButton = onView(withId(R.id.format_bar_button_media_expanded))
63-
headingButton = onView(withId(R.id.format_bar_button_heading))
64-
listButton = onView(withId(R.id.format_bar_button_list))
65-
quoteButton = onView(withId(R.id.format_bar_button_quote))
66-
boldButton = onView(withId(R.id.format_bar_button_bold))
67-
italicsButton = onView(withId(R.id.format_bar_button_italic))
68-
linkButton = onView(withId(R.id.format_bar_button_link))
69-
underlineButton = onView(withId(R.id.format_bar_button_underline))
70-
strikethroughButton = onView(withId(R.id.format_bar_button_strikethrough))
71-
horizontalRuleButton = onView(withId(R.id.format_bar_button_horizontal_rule))
72-
moreRuleButton = onView(withId(R.id.format_bar_button_more))
73-
pageButton = onView(withId(R.id.format_bar_button_page))
74-
htmlButton = onView(withId(R.id.format_bar_button_html))
63+
openMediaToolbarButton = onView(withId(AztecR.id.format_bar_button_media_collapsed))
64+
closeMediaToolbarButton = onView(withId(AztecR.id.format_bar_button_media_expanded))
65+
headingButton = onView(withId(AztecR.id.format_bar_button_heading))
66+
listButton = onView(withId(AztecR.id.format_bar_button_list))
67+
quoteButton = onView(withId(AztecR.id.format_bar_button_quote))
68+
boldButton = onView(withId(AztecR.id.format_bar_button_bold))
69+
italicsButton = onView(withId(AztecR.id.format_bar_button_italic))
70+
linkButton = onView(withId(AztecR.id.format_bar_button_link))
71+
underlineButton = onView(withId(AztecR.id.format_bar_button_underline))
72+
strikethroughButton = onView(withId(AztecR.id.format_bar_button_strikethrough))
73+
horizontalRuleButton = onView(withId(AztecR.id.format_bar_button_horizontal_rule))
74+
moreRuleButton = onView(withId(WPCommentsR.id.format_bar_button_more))
75+
pageButton = onView(withId(WPCommentsR.id.format_bar_button_page))
76+
htmlButton = onView(withId(AztecR.id.format_bar_button_html))
7577

7678
photoButton = onView(allOf(withId(android.R.id.title), withText("Photo from device")))
7779
galleryButton = onView(withId(R.id.media_bar_button_gallery))

app/src/main/kotlin/org/wordpress/aztec/demo/MainActivity.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import org.wordpress.aztec.util.AztecLog
7070
import org.xml.sax.Attributes
7171
import java.io.File
7272
import java.util.Random
73+
import org.wordpress.aztec.R as AztecR
7374

7475
open class MainActivity : AppCompatActivity(),
7576
AztecText.OnImeBackListener,
@@ -489,7 +490,7 @@ open class MainActivity : AppCompatActivity(),
489490
aztec.visualEditor.setCalypsoMode(false)
490491
aztec.sourceEditor?.setCalypsoMode(false)
491492

492-
aztec.visualEditor.setBackgroundSpanColor(ContextCompat.getColor(this, R.color.blue_dark))
493+
aztec.visualEditor.setBackgroundSpanColor(ContextCompat.getColor(this, AztecR.color.blue_dark))
493494

494495
aztec.sourceEditor?.displayStyledAndFormattedHtml(EXAMPLE)
495496

@@ -704,7 +705,7 @@ open class MainActivity : AppCompatActivity(),
704705
startActivityForResult(intent, REQUEST_MEDIA_PHOTO)
705706
} catch (exception: ActivityNotFoundException) {
706707
AppLog.e(AppLog.T.EDITOR, exception.message)
707-
ToastUtils.showToast(this, getString(R.string.error_chooser_photo), ToastUtils.Duration.LONG)
708+
ToastUtils.showToast(this, getString(AztecR.string.error_chooser_photo), ToastUtils.Duration.LONG)
708709
}
709710
}
710711
}
@@ -719,7 +720,7 @@ open class MainActivity : AppCompatActivity(),
719720
startActivityForResult(intent, REQUEST_MEDIA_VIDEO)
720721
} catch (exception: ActivityNotFoundException) {
721722
AppLog.e(AppLog.T.EDITOR, exception.message)
722-
ToastUtils.showToast(this, getString(R.string.error_chooser_video), ToastUtils.Duration.LONG)
723+
ToastUtils.showToast(this, getString(AztecR.string.error_chooser_video), ToastUtils.Duration.LONG)
723724
}
724725
}
725726
}
@@ -819,7 +820,7 @@ open class MainActivity : AppCompatActivity(),
819820
val mediaPending = aztec.visualEditor.getAllElementAttributes(uploadingPredicate).isNotEmpty()
820821

821822
if (mediaPending) {
822-
ToastUtils.showToast(this, R.string.media_upload_dialog_message)
823+
ToastUtils.showToast(this, AztecR.string.media_upload_dialog_message)
823824
} else {
824825
aztec.toolbar.toggleEditorMode()
825826
}
@@ -858,8 +859,8 @@ open class MainActivity : AppCompatActivity(),
858859

859860
private fun showMediaUploadDialog() {
860861
val builder = AlertDialog.Builder(this)
861-
builder.setMessage(getString(org.wordpress.aztec.R.string.media_upload_dialog_message))
862-
builder.setPositiveButton(getString(org.wordpress.aztec.R.string.media_upload_dialog_positive), null)
862+
builder.setMessage(getString(AztecR.string.media_upload_dialog_message))
863+
builder.setPositiveButton(getString(AztecR.string.media_upload_dialog_positive), null)
863864
mediaUploadDialog = builder.create()
864865
mediaUploadDialog!!.show()
865866
}

gradle.properties

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
# The setting is particularly useful for tweaking memory settings.
1212
# Default value: -Xmx10248m -XX:MaxPermSize=256m
1313
org.gradle.jvmargs=-Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14-
android.enableJetifier=false
15-
android.useAndroidX=true
16-
17-
1814
# When configured, Gradle will run in incubating parallel mode.
1915
# This option should only be used with decoupled projects. More details, visit
2016
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
21-
org.gradle.parallel=true
17+
org.gradle.parallel=true
18+
19+
# AztecAndroid-Android properties.
20+
21+
android.enableJetifier=false
22+
android.useAndroidX=true
23+
24+
android.nonTransitiveRClass=true

settings.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
pluginManagement {
22
gradle.ext.kotlinVersion = '1.6.10'
33
gradle.ext.agpVersion = '7.2.1'
4+
gradle.ext.automatticPublishToS3Version = '0.7.0'
45

56
plugins {
67
id "com.android.library" version gradle.ext.agpVersion
78
id "com.android.application" version gradle.ext.agpVersion
89
id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
9-
id "com.automattic.android.publish-to-s3" version "0.7.0"
10+
id "com.automattic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version
1011
}
1112
repositories {
1213
maven {

0 commit comments

Comments
 (0)