Skip to content

Commit

Permalink
Merge branch 'trunk' into issue/12836-media-upload-wpv2
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle/libs.versions.toml
  • Loading branch information
hichamboushaba committed Nov 21, 2024
2 parents 3a6ac00 + af5b7a5 commit 93317cb
Show file tree
Hide file tree
Showing 115 changed files with 3,231 additions and 1,342 deletions.
1 change: 0 additions & 1 deletion .buildkite/commands/lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash -u

echo "--- 🧹 Linting"
cp gradle.properties-example gradle.properties
./gradlew :WooCommerce:lintJalapenoDebug
app_lint_exit_code=$?

Expand Down
1 change: 0 additions & 1 deletion .buildkite/commands/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

echo "--- 🧪 Testing"
set +e
cp gradle.properties-example gradle.properties
./gradlew testJalapenoDebugUnitTest lib:cardreader:testDebugUnitTest lib:iap:testDebugUnitTest
TESTS_EXIT_STATUS=$?
set -e
Expand Down
5 changes: 1 addition & 4 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ steps:
- label: "detekt"
command: |
echo "--- 🧹 Linting"
cp gradle.properties-example gradle.properties
./gradlew detektAll
plugins: [$CI_TOOLKIT]
artifact_paths:
Expand All @@ -50,9 +49,7 @@ steps:
- "**/build/reports/lint-results*.*"

- label: "Dependency Tree Diff"
command: |
cp gradle.properties-example gradle.properties
comment_with_dependency_diff 'woocommerce' 'vanillaReleaseRuntimeClasspath'
command: comment_with_dependency_diff 'woocommerce' 'vanillaReleaseRuntimeClasspath'
if: build.pull_request.id != null
plugins: [$CI_TOOLKIT]
artifact_paths:
Expand Down
1 change: 0 additions & 1 deletion .buildkite/schedules/dependency-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ steps:
- label: "dependency analysis"
command: |
echo "--- 📊 Analyzing"
cp gradle.properties-example gradle.properties
./gradlew buildHealth
plugins: [$CI_TOOLKIT]
artifact_paths:
Expand Down
10 changes: 4 additions & 6 deletions .configure
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"project_name": "woocommerce-android",
"branch": "trunk",
"pinned_hash": "126ffacbbfc7abf1f4bf14670d72418846f04673",
"pinned_hash": "680e4785bcbf8bdc9f3ab6c0f7af24cd3f87dea2",
"files_to_copy": [
{
"file": "android/WCAndroid/gradle.properties",
"destination": "gradle.properties",
"file": "android/WCAndroid/secrets.properties",
"destination": "~/.configure/woocommerce-android/secrets/secrets.properties",
"encrypt": true
},
{
Expand Down Expand Up @@ -44,7 +44,5 @@
"encrypt": true
}
],
"file_dependencies": [

]
"file_dependencies": []
}
Binary file added .configure-files/secrets.properties.enc
Binary file not shown.
1 change: 0 additions & 1 deletion .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- run: cp gradle.properties-example gradle.properties
- name: Setup Gradle to generate and submit dependency graphs
uses: gradle/actions/dependency-submission@v3
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ artifacts/
.gradle/
build/
*/build/
gradle.properties
developer.properties

# Crash Logging Configuration
fabric.properties
Expand Down
21 changes: 11 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GEM
base64
nkf
rexml
activesupport (7.2.2)
activesupport (8.0.0)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -17,30 +17,31 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
artifactory (3.0.17)
ast (2.4.2)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.1001.0)
aws-sdk-core (3.211.0)
aws-partitions (1.1009.0)
aws-sdk-core (3.213.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.95.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.169.0)
aws-sdk-s3 (1.171.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
benchmark (0.3.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
buildkit (1.6.1)
sawyer (>= 0.6)
Expand Down Expand Up @@ -164,7 +165,7 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-wpmreleasetoolkit (12.3.0)
fastlane-plugin-wpmreleasetoolkit (12.3.2)
activesupport (>= 6.1.7.1)
buildkit (~> 1.5)
chroma (= 0.2.0)
Expand Down Expand Up @@ -231,7 +232,7 @@ GEM
concurrent-ruby (~> 1.0)
java-properties (0.3.0)
jmespath (1.6.2)
json (2.7.6)
json (2.8.2)
jwt (2.9.3)
base64
kramdown (2.4.0)
Expand Down Expand Up @@ -266,7 +267,7 @@ GEM
sawyer (~> 0.9)
open4 (1.3.4)
options (2.3.2)
optparse (0.5.0)
optparse (0.6.0)
os (1.1.4)
parallel (1.26.3)
parser (3.3.6.0)
Expand Down Expand Up @@ -311,7 +312,7 @@ GEM
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
securerandom (0.3.1)
securerandom (0.3.2)
security (0.1.5)
signet (0.19.0)
addressable (~> 2.8)
Expand All @@ -334,6 +335,7 @@ GEM
concurrent-ruby (~> 1.0)
uber (0.1.0)
unicode-display_width (2.6.0)
uri (1.0.2)
word_wrap (1.0.0)
xcodeproj (1.27.0)
CFPropertyList (>= 2.3.3, < 4.0)
Expand All @@ -351,7 +353,6 @@ PLATFORMS
aarch64-linux
arm-linux
arm64-darwin
ruby
x86-linux
x86_64-darwin
x86_64-linux
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@
$ cd woocommerce-android
```

1. Generate the developer oauth2 tokens. These values get copied into the main `gradle.properties` file in the next step. See the [OAuth2 Authentication](docs/project-overview.md#oauth2-authentication) section for details.
1. Generate the `gradle.properties` file for this app:

```bash
$ cp ./gradle.properties-example ./gradle.properties
```

1. Open and modify the newly created `gradle.properties` files. See the [Configuration Files](docs/project-overview.md#configuration-files) section for a breakdown of the properties.
1. Create a new `~/.configure/woocommerce-android/secrets.properties` file. See the [Configuration Files](docs/project-overview.md#configuration-files) section for a breakdown of the properties.
1. Generate the developer oauth2 tokens. These values get copied into the `~/.configure/woocommerce-android/secrets.properties` file in the next step. See the [OAuth2 Authentication](docs/project-overview.md#oauth2-authentication) section for details.
1. In Android Studio, open the project from the local repository. This will auto-generate `local.properties` with the SDK location.
1. Optional: Go to Tools → Device Manager and create an emulated device.
1. Run. (Creates a default virtual device if you skipped the previous step)
Expand Down
11 changes: 7 additions & 4 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]
*** Use [*****] to indicate smoke tests of all critical flows should be run on the final APK before release (e.g. major library or targetSdk updates).
*** For entries which are touching the Android Wear app's, start entry with `[WEAR]` too.
21.3
-----
- [*] Switched to use `/wp/v2` for media uploads on Jetpack sites, this fixes media upload issues caused by XMLRPC problems [https://github.com/woocommerce/woocommerce-android/pull/12938]

21.2
-----
- [Internal] Changed a way how authenticated web view opened in the IPP flows [https://github.com/woocommerce/woocommerce-android/pull/12908]
- [Internal][POS] Onboarding to the IPP now is part of the POS [https://github.com/woocommerce/woocommerce-android/pull/12942]
- [*] Fixed an inconsistent state while refreshing the orders list [https://github.com/woocommerce/woocommerce-android/pull/12948]
- [**][Payments] Fixed a bug when IPP onboarding was not possible to finish from the app [https://github.com/woocommerce/woocommerce-android/pull/12917]
- [*] Fixed shipping lines being editable at all states [https://github.com/woocommerce/woocommerce-android/pull/12890]
- [*] Fixed a crash that occurred when tapping on the customer shipping address in the order details screen [https://github.com/woocommerce/woocommerce-android/pull/12920]
- [*][Payments] Fixed a bug when loading indicator was shown forever after fetching of a receipt failed [https://github.com/woocommerce/woocommerce-android/pull/12950]
- [**] Enables creating a new WP.com account during Jetpack activation flow [https://github.com/woocommerce/woocommerce-android/issues/11114]
- [*] Renamed Deposits to Payouts [https://github.com/woocommerce/woocommerce-android/pull/12961]
- [*] Switched to use `/wp/v2` for media uploads on Jetpack sites, this fixes media upload issues caused by XMLRPC problems [https://github.com/woocommerce/woocommerce-android/pull/12938]

21.1
-----
Expand Down
63 changes: 24 additions & 39 deletions WooCommerce-Wear/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,29 @@ android {
dimension "buildType"
}
}

signingConfigs {
if (["uploadStoreFile", "uploadStorePassword", "uploadKeyAlias", "uploadKeyPassword"].count { !secretProperties.containsKey(it) } == 0) {
logger.info("App signing properties found in secrets.properties, configuring signing for release builds.")
release {
storeFile = rootProject.file(secretProperties.get("uploadStoreFile"))
storePassword = secretProperties.get("uploadStorePassword")
keyAlias = secretProperties.get("uploadKeyAlias")
keyPassword = secretProperties.get("uploadKeyPassword")
}
android.buildTypes.release.signingConfig = android.signingConfigs.release
}

if (secretProperties.containsKey("debugStoreFile")) {
logger.info("Debug signing properties found in secrets.properties, configuring signing for debug builds.")
def sharedDebugStore = file(secretProperties.get("debugStoreFile").replaceFirst("^~", System.getProperty("user.home")))
if (sharedDebugStore.exists()) {
debug {
storeFile sharedDebugStore
}
}
}
}
}

dependencies {
Expand Down Expand Up @@ -213,18 +236,8 @@ dependencies {
lintChecks(libs.android.security.lint)
}

def checkGradlePropertiesFile() {
def inputFile = file("${rootDir}/gradle.properties")
if (!inputFile.exists()) {
throw new StopActionException("Build configuration file gradle.properties doesn't exist, follow README instructions")
}
return inputFile
}

android.buildTypes.all { buildType ->
def inputFile = checkGradlePropertiesFile()
def properties = loadPropertiesFromFile(inputFile)
properties.any { property ->
(secretProperties + developerProperties).any { property ->
if (property.key.toLowerCase().startsWith("wc.")) {
buildType.buildConfigField "String", property.key.replace("wc.", "").replace(".", "_").toUpperCase(),
"\"${property.value}\""
Expand All @@ -243,31 +256,3 @@ static def loadPropertiesFromFile(inputFile) {
}
return properties
}

// For app signing
if (["uploadStoreFile", "uploadStorePassword", "uploadKeyAlias", "uploadKeyPassword"].count { !project.hasProperty(it) } == 0) {
android {
signingConfigs {
release {
storeFile = rootProject.file(project.uploadStoreFile)
storePassword = project.uploadStorePassword
keyAlias = project.uploadKeyAlias
keyPassword = project.uploadKeyPassword
}
}
}
android.buildTypes.release.signingConfig = android.signingConfigs.release
}

if (project.hasProperty("debugStoreFile")) {
def sharedDebugStore = file(project.debugStoreFile.replaceFirst("^~", System.getProperty("user.home")))
if (sharedDebugStore.exists()) {
android {
signingConfigs {
debug {
storeFile sharedDebugStore
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.woocommerce.android.wear.ui.stats.datasource.FetchStats.StoreStatsReq
import com.woocommerce.android.wear.ui.stats.datasource.FetchStats.StoreStatsRequest.Finished
import com.woocommerce.android.wear.ui.stats.datasource.FetchStats.StoreStatsRequest.Waiting
import com.woocommerce.android.wear.ui.stats.datasource.StoreStatsData.RevenueData
import com.woocommerce.android.wear.ui.stats.datasource.StoreStatsData.StatRequest
import com.woocommerce.commons.MessagePath
import com.woocommerce.commons.WearAnalyticsEvent.WATCH_DATA_REQUESTED_FROM_PHONE
import com.woocommerce.commons.WearAnalyticsEvent.WATCH_DATA_REQUESTED_FROM_STORE
Expand All @@ -28,8 +29,8 @@ class FetchStats @Inject constructor(
private val connectionStatus: ConnectionStatus,
private val analyticsTracker: AnalyticsTracker
) {
private val revenueStats = MutableStateFlow<RevenueData?>(null)
private val visitorStats = MutableStateFlow<Int?>(null)
private val revenueStats = MutableStateFlow<StatRequest<RevenueData>>(StatRequest.Waiting())
private val visitorStats = MutableStateFlow<StatRequest<Int>>(StatRequest.Waiting())

suspend operator fun invoke(
selectedSite: SiteModel
Expand Down Expand Up @@ -90,10 +91,10 @@ class FetchStats @Inject constructor(
orderCount = totals?.ordersCount ?: 0
)

revenueStats.value = revenueData
revenueStats.value = StatRequest.Finished(revenueData)
},
onFailure = {
revenueStats.value = null
revenueStats.value = StatRequest.Error()
}
)
}
Expand All @@ -102,10 +103,10 @@ class FetchStats @Inject constructor(
statsRepository.fetchVisitorStats(selectedSite)
.fold(
onSuccess = { visitors ->
visitorStats.value = visitors ?: 0
visitorStats.value = StatRequest.Finished(visitors ?: 0)
},
onFailure = {
visitorStats.value = null
visitorStats.value = StatRequest.Error()
}
)
}
Expand Down
Loading

0 comments on commit 93317cb

Please sign in to comment.