From 5dc3418665a51e00b4aac7f2f203b207fd5796df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Kula?= Date: Wed, 18 Sep 2019 02:33:59 -0700 Subject: [PATCH] Create module for AshmemMemory Summary: Create module for new AshmemMemory type. Reviewed By: oprisnik, defHLT Differential Revision: D17162148 fbshipit-source-id: 8fad888f234d3348fc45760cb13cd0298b1791ac --- animated-base/build.gradle | 1 + animated-drawable/build.gradle | 1 + drawee-backends/drawee-pipeline/build.gradle | 1 + drawee/build.gradle | 1 + .../imagepipeline-okhttp/build.gradle | 1 + .../imagepipeline-okhttp3/build.gradle | 1 + .../imagepipeline-volley/build.gradle | 1 + memory-types/ashmem/build.gradle | 47 +++++++++++++++++++ .../ashmem/src/main/AndroidManifest.xml | 6 +++ native-filters/build.gradle | 1 + samples/comparison/build.gradle | 1 + settings.gradle | 1 + tools/flipper/build.gradle | 1 + tools/stetho/build.gradle | 1 + vito/core/build.gradle | 1 + vito/options/build.gradle | 1 + 16 files changed, 67 insertions(+) create mode 100644 memory-types/ashmem/build.gradle create mode 100644 memory-types/ashmem/src/main/AndroidManifest.xml diff --git a/animated-base/build.gradle b/animated-base/build.gradle index 8a5324b201..76705928bf 100644 --- a/animated-base/build.gradle +++ b/animated-base/build.gradle @@ -11,6 +11,7 @@ dependencies { api project(':fbcore') api project(':imagepipeline-base') api project(':imagepipeline') + api project(':memory-types:ashmem') api project(':memory-types:nativememory') api project(':memory-types:simple') api project(':animated-drawable') diff --git a/animated-drawable/build.gradle b/animated-drawable/build.gradle index 1877ad2e43..ea45fdf85e 100644 --- a/animated-drawable/build.gradle +++ b/animated-drawable/build.gradle @@ -44,6 +44,7 @@ dependencies { testImplementation project(':imagepipeline-test') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') implementation project(':drawee') diff --git a/drawee-backends/drawee-pipeline/build.gradle b/drawee-backends/drawee-pipeline/build.gradle index 6e8d5d5e88..d0d14e2ecf 100644 --- a/drawee-backends/drawee-pipeline/build.gradle +++ b/drawee-backends/drawee-pipeline/build.gradle @@ -12,6 +12,7 @@ dependencies { api project(':fbcore') api project(':drawee') api project(':imagepipeline') + api project(':memory-types:ashmem') api project(':memory-types:nativememory') api project(':memory-types:simple') api project(':native-filters') diff --git a/drawee/build.gradle b/drawee/build.gradle index 0f327eaf19..aff1c63020 100644 --- a/drawee/build.gradle +++ b/drawee/build.gradle @@ -12,6 +12,7 @@ dependencies { implementation project(':fbcore') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') diff --git a/imagepipeline-backends/imagepipeline-okhttp/build.gradle b/imagepipeline-backends/imagepipeline-okhttp/build.gradle index 14039f3820..642a0b6650 100644 --- a/imagepipeline-backends/imagepipeline-okhttp/build.gradle +++ b/imagepipeline-backends/imagepipeline-okhttp/build.gradle @@ -10,6 +10,7 @@ dependencies { implementation project(':fbcore') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') } diff --git a/imagepipeline-backends/imagepipeline-okhttp3/build.gradle b/imagepipeline-backends/imagepipeline-okhttp3/build.gradle index 0f6d5c60b3..49c1c575b2 100644 --- a/imagepipeline-backends/imagepipeline-okhttp3/build.gradle +++ b/imagepipeline-backends/imagepipeline-okhttp3/build.gradle @@ -10,6 +10,7 @@ dependencies { implementation project(':fbcore') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') } diff --git a/imagepipeline-backends/imagepipeline-volley/build.gradle b/imagepipeline-backends/imagepipeline-volley/build.gradle index 9ab8d310ee..77fff53631 100644 --- a/imagepipeline-backends/imagepipeline-volley/build.gradle +++ b/imagepipeline-backends/imagepipeline-volley/build.gradle @@ -8,6 +8,7 @@ dependencies { implementation project(':fbcore') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') implementation project(':imagepipeline-base') diff --git a/memory-types/ashmem/build.gradle b/memory-types/ashmem/build.gradle new file mode 100644 index 0000000000..e2af968f4e --- /dev/null +++ b/memory-types/ashmem/build.gradle @@ -0,0 +1,47 @@ +apply plugin: 'com.android.library' +apply plugin: 'maven' + +project.group = GROUP +version = VERSION_NAME + +dependencies { + compileOnly "com.google.code.findbugs:jsr305:${JSR_305_VERSION}" + + implementation project(':fbcore') + implementation project(':imagepipeline') + + testImplementation "junit:junit:${JUNIT_VERSION}" + testImplementation "org.assertj:assertj-core:${versions.assertjCore}" + testImplementation "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}" + testImplementation("org.robolectric:robolectric:${ROBOLECTRIC_VERSION}") { + exclude group: 'commons-logging', module: 'commons-logging' + exclude group: 'org.apache.httpcomponents', module: 'httpclient' + } + testImplementation project(':imagepipeline-test') +} + +android { + buildToolsVersion rootProject.ext.buildToolsVersion + compileSdkVersion rootProject.ext.compileSdkVersion + + defaultConfig { + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + } + + lintOptions { + abortOnError false + } +} + +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task testJar(type: Jar) { + from android.sourceSets.test.java.srcDirs + classifier = 'sources' +} + +artifacts.add('archives', sourcesJar) diff --git a/memory-types/ashmem/src/main/AndroidManifest.xml b/memory-types/ashmem/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..8d48710248 --- /dev/null +++ b/memory-types/ashmem/src/main/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + diff --git a/native-filters/build.gradle b/native-filters/build.gradle index 62f372b22d..baadd59aad 100644 --- a/native-filters/build.gradle +++ b/native-filters/build.gradle @@ -12,6 +12,7 @@ dependencies { compileOnly "javax.annotation:javax.annotation-api:${ANNOTATION_API_VERSION}" implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') diff --git a/samples/comparison/build.gradle b/samples/comparison/build.gradle index 4b9d0e96d5..69258534ca 100644 --- a/samples/comparison/build.gradle +++ b/samples/comparison/build.gradle @@ -19,6 +19,7 @@ dependencies { implementation project(':drawee-backends:drawee-volley') implementation project(':fbcore') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') implementation project(':imagepipeline-backends:imagepipeline-okhttp3') diff --git a/settings.gradle b/settings.gradle index 76b777e02a..571ca972b4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,6 +16,7 @@ include ':imagepipeline-backends:imagepipeline-volley' include ':imagepipeline-base' include ':imagepipeline-base-test' include ':imagepipeline-test' +include ':memory-types:ashmem' include ':memory-types:nativememory' include ':memory-types:simple' include ':native-filters' diff --git a/tools/flipper/build.gradle b/tools/flipper/build.gradle index a82120188e..4df2888167 100644 --- a/tools/flipper/build.gradle +++ b/tools/flipper/build.gradle @@ -10,6 +10,7 @@ dependencies { implementation project(':drawee-backends:drawee-pipeline') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') } diff --git a/tools/stetho/build.gradle b/tools/stetho/build.gradle index 1877783c8e..09dc42e8a6 100644 --- a/tools/stetho/build.gradle +++ b/tools/stetho/build.gradle @@ -12,6 +12,7 @@ dependencies { implementation project(':drawee-backends:drawee-pipeline') implementation project(':fbcore') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') implementation project(':imagepipeline-base') diff --git a/vito/core/build.gradle b/vito/core/build.gradle index b1fca0edb3..39bf7ba583 100644 --- a/vito/core/build.gradle +++ b/vito/core/build.gradle @@ -16,6 +16,7 @@ dependencies { implementation project(':drawee-backends:drawee-pipeline') implementation project(':fbcore') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple') implementation project(':vito:options') diff --git a/vito/options/build.gradle b/vito/options/build.gradle index 95c03b1410..508cf3bf29 100644 --- a/vito/options/build.gradle +++ b/vito/options/build.gradle @@ -12,6 +12,7 @@ dependencies { implementation project(':drawee') implementation project(':fbcore') implementation project(':imagepipeline') + implementation project(':memory-types:ashmem') implementation project(':memory-types:nativememory') implementation project(':memory-types:simple')