Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
michael_jess
Participant
Happy new year, everyone! To start off this year, I have amazing news to share: After months of planning, reviews and implementation, I am more than proud to announce that the SAP Cloud Platform SDK for Android is available on the all-new SAP Cloud Shipment channel starting with version 1.1.4*. Now, I assume you are still sitting in your chair because I absolutely haven't explained what it is and why this will bring tremendous agility and momentum to your development teams.

Let's start with what this all-new shipment channel is. Traditionally, due to an array of legal and export-related requirements, our mobile SDKs have been distributed as installation software, meaning that each developer workstation, each container and each virtual machine ever building software using our SDKs would need to come installed with those. In essence, this implies additional setup time and cost per new build server, developer and workstation. Now, in 2019, we are finally able to offer a better alternative similar to well-known public repositories such as Maven Central, Bintray and JCenter: The SAP Cloud Shipment channel. In this very specific case of the Android SDK, we are talking about a customer-facing Maven repository that you can configure in your projects to consume the Cloud Platform SDK for Android without any additional manual downloads.  So how does the process work?



Fig. 1: SAP Repositories Management technical users view

First, you will need to obtain a technical user** on SAP Repositories Management as shown in Figure 1 and download the password file. Secondly, need to add the user name and password to your system environment variables as SAP_MAVEN_USER and SAP_MAVEN_PASSWORD, respectively.

Finally, simply add an init.gradle file to your $HOME/.gradle (*nix) or %USERPROFILE%\.gradle (Windows) folder with the following contents***:
// $HOME/.gradle/init.gradle
allprojects {
ext.SAPRepoConfig = {
maven {
url "https://73555000100800001281.mavensrv.repositories.sapcdn.io
credentials {
username "$System.env.SAP_MAVEN_USER"
password "$System.env.SAP_MAVEN_PASSWORD"
}
}
}
buildscript.repositories SAPRepoConfig
repositories SAPRepoConfig
}

Fig. 2: User-global init.gradle configuration

This will add our repository to your user-global Gradle configuration. From now on you can simply add Cloud Platform SDK for Android dependencies to your module build.gradle files and Gradle will happily fetch the libraries via our infrastructure:
// <project root>/app/build.gradle

dependencies {
...

// SAP Cloud Android SDK dependencies
def sdkVersion = '3.0.0'
implementation group: 'com.sap.cloud.android', name: 'fiori', version: sdkVersion
implementation group: 'com.sap.cloud.android', name: 'onboarding', version: sdkVersion
implementation group:'com.sap.cloud.android', name:'odata', version: sdkVersion
implementation group: 'com.sap.cloud.android', name: 'foundation', version: sdkVersion
...
}

Fig. 3: Project dependency configuration

Now for the best part - those settings are super easy to add to Continuous Integration pipelines and build servers as well, so you'll no longer need to babysit your build infrastructure. Stay tuned for updated content in the SAP Continuous Integration guides as well!

 

*Note: Access to this service requires licensed access to SAP Cloud Platform SDK for Android, e.g. by means of subscribing to SAP Cloud Platform Mobile Services, and a valid S-user for external staff. This service is not available for Trial versions of the SDK.

**Note: Quoting the SAP support site, "you can download the SAP products that are associated with your S-user ID. While every visitor can browse the list of software products without any special permissions, downloading files requires the Software Download authorization; to request it, contact a user administrator in your company." This restriction also applies to the cloud shipment channel. Please also note that credentials generated with this service are subject to expiry after 6 months, and hence need regenerating at least twice a year.

***Note: Due to infrastructure-related limitations, we are currently required to release each major product version to a dedicated Maven repository. In order to access new major versions, you'll need to add the corresponding repositories to the init.gradle configuration.

 

Edit 2019-01-09: Adding a note that the technical user password needs to be downloaded and convenience copy-paste gradle.init contents

Edit 2019-01-10: Replacing screenshots with code blocks

Edit 2019-01-31: Adjusting config to include 2.0 release and adding note on repositories vs. releases

Edit 2019-02-28: Adding a note that accessing the repository requires software download permission

Edit 2019-08-05: Adding a note that credentials need regenerating every 6 months.

Edit 2020-02-28: We are currently facing temporary issues with making the 3.0 release available in Cloud Shipment. Please stay tuned - I will update this blog post as soon as we make progress.

Edit 2020-03-04: We have published the 3.0 release and update the above code snipped to reflect the new repo URL.

Edit 2022-01-11: I updated the NPMRC code snippet to reflect that starting with SDK version 2.1, a single virtual repo may be used for all versions.
6 Comments