Skip to content
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
2 changes: 2 additions & 0 deletions dev/benchmarks/complex_layout/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/benchmarks/macrobenchmarks/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/benchmarks/microbenchmarks/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/benchmarks/platform_views_layout/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/benchmarks/test_apps/stocks/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/android_views/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/channels/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/external_ui/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/flavors/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/flutter_gallery/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/non_nullable/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/release_smoke_test/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/ui/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions dev/manual_tests/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions examples/flutter_view/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions examples/hello_world/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions examples/image_list/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions examples/layers/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions examples/platform_channel/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
2 changes: 2 additions & 0 deletions examples/platform_view/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ allprojects {
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ allprojects {
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart = 2.8

import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/base/file_system.dart';

import '../src/common.dart';
import 'test_utils.dart';

// Test the android/app/build directory not be created unexpectedly after
// `flutter build` commands, see https://github.com/flutter/flutter/issues/91018.
//
// The easiest way to reproduce this issue is to create a plugin project, then run
// `flutter build` command inside the `example` directory, so we create a plugin
// project in the test.
void main() {
Directory tempDir;
String flutterBin;
Directory exampleAppDir;

setUp(() async {
tempDir = createResolvedTempDirectorySync('flutter_plugin_test.');
flutterBin = fileSystem.path.join(
getFlutterRoot(),
'bin',
'flutter',
);
exampleAppDir = tempDir.childDirectory('aaa').childDirectory('example');

processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
'create',
'--template=plugin',
'--platforms=android',
'aaa',
], workingDirectory: tempDir.path);
});

tearDown(() async {
tryToDelete(tempDir);
});

void _checkBuildDir() {
// The android/app/build directory should not exists
final Directory appBuildDir = fileSystem.directory(fileSystem.path.join(
exampleAppDir.path,
'android',
'app',
'build',
));
expect(appBuildDir, isNot(exists));
}

test(
'android/app/build should not exists after flutter build apk',
() async {
processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'apk',
'--target-platform=android-arm',
], workingDirectory: exampleAppDir.path);
_checkBuildDir();
},
);

test(
'android/app/build should not exists after flutter build appbundle',
() async {
processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
'build',
'appbundle',
'--target-platform=android-arm',
], workingDirectory: exampleAppDir.path);
_checkBuildDir();
},
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ class BasicDeferredComponentsConfig extends DeferredComponentsConfig {
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

Expand Down
2 changes: 2 additions & 0 deletions packages/integration_test/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rootProject.buildDir = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')

dependencyLocking {
Expand Down