diff --git a/.gitignore b/.gitignore index 39fb081..31bad9a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ /build /captures .externalNativeBuild +*.log +.idea diff --git a/README.md b/README.md index 7e2f65c..df8f931 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,14 @@ * Build the test application: `./gradlew assembleAndroidTest` (apk will be generated in the `app/build/outputs/apk/androidTest/debug/` directory) * Upload both the apk files to BrowserStack and start a session. Refer our documentation for details: [Using Espresso with BrowserStack](https://www.browserstack.com/app-automate/espresso/get-started) +### Test Reporting & Analytics + +* To integrate BrowserStack Test Reporting & Analytics with Espresso, refer to our documentation: [Test Reporting & Analytics on Espresso](https://www.browserstack.com/docs/test-reporting-and-analytics/quick-start/espresso) + +### App Accessibility Testing + +* To integrate BrowserStack Accessibility to functional tests and generate comprehensive reports of accessibility issues, refer to our documentation: [Integrate Espresso test suite with app accessibility testing](https://www.browserstack.com/docs/app-accessibility/automated-tests/get-started/espresso/integrate-with-app-automate) + ## Notes * You can view your test results on the [BrowserStack app-automate dashboard](https://www.browserstack.com/app-automate) diff --git a/app/build.gradle b/app/build.gradle index 6543b2f..f6b9227 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,47 +1,64 @@ -apply plugin: 'com.android.application' -apply plugin: 'jacoco' -jacoco { - toolVersion='0.7.5.201505241946' -} -buildscript { - repositories { - mavenCentral() - } +plugins { + alias(libs.plugins.android.application) + id 'com.browserstack.gradle-tool' + id 'jacoco' } android { - compileSdkVersion 30 - dataBinding.enabled = true + namespace 'com.sample.browserstack.samplecalculator' + compileSdk 34 defaultConfig { applicationId "com.sample.browserstack.samplecalculator" - minSdkVersion 15 - targetSdkVersion 30 + minSdk 26 + targetSdk 34 versionCode 1 versionName "1.0" - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } + buildTypes { release { minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - debug { - testCoverageEnabled true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + + dataBinding { + enabled = true + } } dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.0.0' - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' - androidTestImplementation 'androidx.test:rules:1.1.1' - androidTestImplementation 'androidx.test.ext:junit:1.1.1' - testImplementation 'junit:junit:4.12' -} \ No newline at end of file + implementation libs.appcompat + implementation libs.material + implementation libs.activity + implementation libs.constraintlayout + testImplementation libs.junit + androidTestImplementation libs.ext.junit + androidTestImplementation libs.espresso.core + + androidTestImplementation(group: 'com.browserstack', name: 'browserstack-java-sdk', version: 'latest.release') { + exclude group: 'com.google.code.findbugs', module: 'jsr305' + } + + configurations.androidTestImplementation { + exclude group: 'com.google.code.findbugs', module: 'jsr305' + } +} + +jacoco { + toolVersion = '0.8.8' +} + +task printSdkVersion { + doLast { + println android.compileSdkVersion + } +} diff --git a/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureInputTests.java b/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureInputTests.java index a765e24..b42efd1 100644 --- a/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureInputTests.java +++ b/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureInputTests.java @@ -1,7 +1,7 @@ package com.sample.browserstack.samplecalculator; import androidx.test.filters.SmallTest; -import androidx.test.rule.ActivityTestRule; +import androidx.test.ext.junit.rules.ActivityScenarioRule; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Before; @@ -25,14 +25,13 @@ public class EnsureInputTests { @Rule - public ActivityTestRule activityRule = - new ActivityTestRule(MainActivity.class); - - private MainActivity mainActivity; + public ActivityScenarioRule activityScenarioRule = + new ActivityScenarioRule<>(MainActivity.class); @Before public void setUp() { - mainActivity = activityRule.getActivity(); + // ActivityScenarioRule handles activity initialization automatically + // No need to manually get activity reference in modern testing } @Test diff --git a/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureOperationTests.java b/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureOperationTests.java index 48e1411..bba1ace 100644 --- a/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureOperationTests.java +++ b/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureOperationTests.java @@ -1,7 +1,7 @@ package com.sample.browserstack.samplecalculator; import androidx.test.filters.MediumTest; -import androidx.test.rule.ActivityTestRule; +import androidx.test.ext.junit.rules.ActivityScenarioRule; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Before; @@ -25,14 +25,13 @@ public class EnsureOperationTests { @Rule - public ActivityTestRule activityRule = - new ActivityTestRule(MainActivity.class); - - private MainActivity mainActivity; + public ActivityScenarioRule activityScenarioRule = + new ActivityScenarioRule<>(MainActivity.class); @Before public void setUp() { - mainActivity = activityRule.getActivity(); + // ActivityScenarioRule handles activity initialization automatically + // No need to manually get activity reference in modern testing } @Test diff --git a/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureRandomTests.java b/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureRandomTests.java index 9524c6c..c85635a 100644 --- a/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureRandomTests.java +++ b/app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureRandomTests.java @@ -1,7 +1,7 @@ package com.sample.browserstack.samplecalculator; import androidx.test.filters.MediumTest; -import androidx.test.rule.ActivityTestRule; +import androidx.test.ext.junit.rules.ActivityScenarioRule; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Rule; @@ -26,8 +26,8 @@ public class EnsureRandomTests { @Rule - public ActivityTestRule activityRule = - new ActivityTestRule(MainActivity.class); + public ActivityScenarioRule activityScenarioRule = + new ActivityScenarioRule<>(MainActivity.class); @Test public void testZeroMultiplication() { diff --git a/app/src/androidTest/java/com/sample/browserstack/samplecalculator/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/sample/browserstack/samplecalculator/ExampleInstrumentedTest.java index 2e25e20..c00795c 100644 --- a/app/src/androidTest/java/com/sample/browserstack/samplecalculator/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/com/sample/browserstack/samplecalculator/ExampleInstrumentedTest.java @@ -1,13 +1,25 @@ package com.sample.browserstack.samplecalculator; -import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.replaceText; +import static androidx.test.espresso.matcher.ViewMatchers.withId; + +import android.util.Log; + +import androidx.test.espresso.Espresso; +import androidx.test.ext.junit.rules.ActivityScenarioRule; import androidx.test.ext.junit.runners.AndroidJUnit4; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; +import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import com.browserstack.accessibility.AccessibilityUtils; /** * Instrumented test, which will execute on an Android device. @@ -16,10 +28,89 @@ */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { + @Rule + public ActivityScenarioRule activityScenarioRule = + new ActivityScenarioRule<>(MainActivity.class); + + @Before + public void myBeforeEach() throws Exception{ + Log.d("TRANSFORMATION_LOGS", "From @Before"); + } + + @Test + public void testCalculatorBasicOperation() { + android.util.Log.d("TRANSFORMATION_LOGS", "IN TEST"); + Espresso.onView(withId(R.id.buttonTwo)).perform(click()); + Espresso.onView(withId(R.id.buttonAdd)).perform(click()); + Espresso.onView(withId(R.id.buttonThree)).perform(click()); + Espresso.onView(withId(R.id.buttonEqual)).perform(click()); + } + + @Test + public void exceptionFailedTest() throws Exception { + Espresso.onView(withId(R.id.buttonFive)).perform(click()); + Espresso.onView(withId(R.id.buttonMultiply)).perform(click()); + Espresso.onView(withId(R.id.buttonTwo)).perform(click()); + Espresso.onView(withId(R.id.buttonEqual)).perform(click()); + throw new Exception("EXCEPTION FROM TEST"); + } + + @Test + @Category(ExampleInstrumentedTest.class) + public void assertionFailedTest() throws Exception { + Log.d("TEST_LOGS", "testStarted"); + + Espresso.onView(withId(R.id.buttonOne)).perform(click()); + Espresso.onView(withId(R.id.buttonAdd)).perform(click()); + Espresso.onView(withId(R.id.buttonOne)).perform(click()); + Espresso.onView(withId(R.id.buttonEqual)).perform(click()); + + Log.d("PERFORM_SCAN_LOGS", "beforeScan"); + AccessibilityUtils.performEspressoAppAccessibilityScan(""); + Log.d("PERFORM_SCAN_LOGS", "afterScan"); + + Thread.sleep(10000); + + Log.d("A11Y_RESULTS_SUMMARY", AccessibilityUtils.getResultsSummary().toString()); + Log.d("A11Y_RESULTS", AccessibilityUtils.getResults().toString()); + + Assert.assertTrue(false); + Thread.sleep(2000); + + Log.d("TEST_LOGS", "testEnded"); + } + + @Test + @Category(MainActivity.class) + public void testTags() throws InterruptedException{ + Log.d("TEST_LOGS", "testStarted"); + + Assert.assertTrue(true); + Thread.sleep(10000); + + Log.d("A11Y_RESULTS_SUMMARY", AccessibilityUtils.getResultsSummary().toString()); + Log.d("A11Y_RESULTS", AccessibilityUtils.getResults().toString()); + + Log.d("TEST_LOGS", "testEnded"); + } + + @Test + @Ignore + public void testIgnored() throws InterruptedException { + Log.d("TRANSFORMATION_LOGS", "testIgnored"); + Thread.sleep(2000); + } + + @Test + @Ignore("IGNORE MESSAGE") + public void testIgnoredWithMessage() throws InterruptedException { + Log.d("TRANSFORMATION_LOGS", "testIgnoredWithMessage"); + Thread.sleep(2000); + } + @Test - public void useAppContext() { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("com.sample.browserstack.samplecalculator", appContext.getPackageName()); + public void testAssumptionFailure() throws InterruptedException { + Assume.assumeTrue(false); + Thread.sleep(2000); } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 69a6e9f..05cf99d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,16 +1,23 @@ + xmlns:tools="http://schemas.android.com/tools"> + + - - + android:theme="@style/AppTheme" + tools:targetApi="31"> + diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..810850d --- /dev/null +++ b/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..0c4f95c --- /dev/null +++ b/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + diff --git a/build.gradle b/build.gradle index 967757b..13ca064 100644 --- a/build.gradle +++ b/build.gradle @@ -7,19 +7,13 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' + classpath 'com.android.tools.build:gradle:8.5.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files + classpath 'com.browserstack:gradle-tool:1.1.0' } } -allprojects { - repositories { - google() - jcenter() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir +plugins { +alias(libs.plugins.android.application) apply false } diff --git a/gradle.properties b/gradle.properties index 9e6fce1..efa05a1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -android.enableJetifier=true +android.enableJetifier=false android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..4874452 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,22 @@ +[versions] +agp = "8.5.0" +junit = "4.13.2" +junitVersion = "1.2.1" +espressoCore = "3.6.1" +appcompat = "1.7.0" +material = "1.12.0" +activity = "1.9.0" +constraintlayout = "2.1.4" + +[libraries] +junit = { group = "junit", name = "junit", version.ref = "junit" } +ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } +constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } + diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 13372ae..e708b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 14b3a0b..4257128 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Nov 08 15:53:49 IST 2019 +#Fri Jul 12 21:59:43 IST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip diff --git a/gradlew b/gradlew index 9d82f78..4f906e0 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,20 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## ## @@ -6,20 +22,38 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -30,6 +64,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,28 +75,14 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -85,7 +106,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -105,10 +126,11 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath @@ -134,27 +156,30 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index aec9973..ac1b06f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -8,20 +24,23 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,34 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle index e7b4def..7097817 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,26 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + // flatDir { + // dirs '/Users/amaan/Documents/Work/Current_Issues/Observability/Solutioning_POC/SDK/browserstack-javaagent/target' + // } + } +} + +rootProject.name = "espresso-browserstack" include ':app'