Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Maven group ID used for all components
componentsGroupId: "org.mozilla.components"

# Synchronized build configuration for all modules
compileSdkVersion: 29
minSdkVersion: 21
targetSdkVersion: 29
18 changes: 0 additions & 18 deletions buildSrc/src/main/java/Config.kt

This file was deleted.

6 changes: 3 additions & 3 deletions components/browser/state/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion Config.compileSdkVersion
compileSdkVersion config.compileSdkVersion

defaultConfig {
minSdkVersion Config.minSdkVersion
targetSdkVersion Config.targetSdkVersion
minSdkVersion config.minSdkVersion
targetSdkVersion config.targetSdkVersion
}

buildTypes {
Expand Down
8 changes: 4 additions & 4 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permalink: /changelog/
* [Milestone](https://github.com/mozilla-mobile/android-components/milestone/113?closed=1)
* [Dependencies](https://github.com/mozilla-mobile/android-components/blob/master/buildSrc/src/main/java/Dependencies.kt)
* [Gecko](https://github.com/mozilla-mobile/android-components/blob/master/buildSrc/src/main/java/Gecko.kt)
* [Configuration](https://github.com/mozilla-mobile/android-components/blob/master/buildSrc/src/main/java/Config.kt)
* [Configuration](https://github.com/mozilla-mobile/android-components/blob/master/.config.yml)

* **concept-menu**
* Added `orientation` parameter to `MenuController.show`. Passing null (the default) tells the menu to determine the best orientation itself.
Expand All @@ -20,13 +20,13 @@ permalink: /changelog/

* **feature-app-links**
* Added `loadUrlUseCase` as a parameter for `AppLinksFeature`. This is used to load the URL if the user decides to not launch the link in the external app.

* **concept-awesomebar**
* Added `AwesomeBar.setOnEditSuggestionListener()` to register a callback when a search term is selected to be edited further.

* **browser-toolbar**
* `BrowserToolbar.setSearchTerms()` can now be called during `State.EDIT`

* **browser-awesomebar**
* The view of `DefaultSuggestionViewHolder` now contains a button to select a search term for further editing. Clicking it will invoke the callback registered in `BrowserAwesomeBar.setOnEditSuggestionListener()`

Expand Down Expand Up @@ -69,7 +69,7 @@ permalink: /changelog/
* ⚠️ **This is a breaking change**: `DownloadsFeature` is no longer accepting a custom download dialog but supporting customizations via the `promptStyling` parameter. The `dialog` parameter was unused so far. If it's required in the future it will need to be replaced with a lambda or factory so that the feature can create instances of the dialog itself, as needed.

* **feature-webcompat-reporter**
* Added a second parameter to the `install` method: `productName` allows to provide a unique product name per usage for automatic product-labelling on webcompat.com
* Added a second parameter to the `install` method: `productName` allows to provide a unique product name per usage for automatic product-labelling on webcompat.com

* **feature-contextmenu**
* Do not show the "Download link" option for html URLs.
Expand Down
35 changes: 34 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,32 @@ buildCache {
}
}

// Synchronized library configuration for all modules
// This "componentsVersion" number is defined in ".buildconfig.yml" and should follow
// semantic versioning (MAJOR.MINOR.PATCH). See https://semver.org/
class Config {

public final String componentsVersion
public final String componentsGroupId
public final Integer compileSdkVersion
public final Integer minSdkVersion
public final Integer targetSdkVersion

Config(
String componentsVersion,
String componentsGroupId,
Integer compileSdkVersion,
Integer minSdkVersion,
Integer targetSdkVersion
) {
this.componentsVersion = componentsVersion
this.componentsGroupId = componentsGroupId
this.compileSdkVersion = compileSdkVersion
this.minSdkVersion = minSdkVersion
this.targetSdkVersion = targetSdkVersion
}
}

def setupProject(name, path, description) {
settings.include(":$name")

Expand All @@ -43,6 +69,7 @@ buildconfig.projects.each { project ->
}

gradle.projectsLoaded { ->
def configData = yaml.load(new File(rootDir, '.config.yml').newInputStream())
String version = buildconfig.componentsVersion

if (gradle.rootProject.hasProperty("nightlyVersion")) {
Expand All @@ -55,7 +82,13 @@ gradle.projectsLoaded { ->
// Wait until root project is "loaded" before we set "config"
// Note that since this is set on "rootProject.ext", it will be "in scope" during the evaluation of all projects'
// gradle files. This means that they can just access "config.<value>", and it'll function properly
gradle.rootProject.ext.config = new Config(version)
gradle.rootProject.ext.config = new Config(
version,
configData.componentsGroupId,
configData.compileSdkVersion,
configData.minSdkVersion,
configData.targetSdkVersion
)
gradle.rootProject.ext.buildConfig = buildconfig
}

Expand Down
2 changes: 1 addition & 1 deletion taskcluster/ci/toolchain/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ linux64-android-sdk-linux-repack:
run:
script: repack-android-sdk-linux.sh
resources:
- buildSrc/src/main/java/Config.kt
- .config.yml
toolchain-artifact: mobile/android-sdk/android-sdk-linux.tar.xz
toolchain-alias: android-sdk-linux
treeherder:
Expand Down