forked from square/dagger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request square#456 from google/moe_writing_branch_from_fbb…
…684005f94867c54a07e824985836d845ce654 Moe sync 9/6
- Loading branch information
Showing
11 changed files
with
238 additions
and
129 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
compiler/src/it/functional-tests/src/main/java/test/multipackage/MultibindsComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (C) 2016 The Dagger 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 | ||
* | ||
* http://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. | ||
*/ | ||
|
||
package test.multipackage; | ||
|
||
import dagger.Component; | ||
import test.multipackage.a.AMultibindsModule; | ||
import test.multipackage.a.UsesInaccessible; | ||
|
||
/** | ||
* A component that tests the interaction between multiple packages and {@code @Multibinding}s. | ||
* Specifically, we want: | ||
* | ||
* <ul> | ||
* <li>A {@code @Multibinding} for an empty set of a type not accessible from this package. | ||
* <li>A {@code @Multibinding} for an empty map of a type not accessible from this package. | ||
* <li>A public type that injects the empty set and map of inaccessible objects. | ||
* </ul> | ||
*/ | ||
@Component(modules = {AMultibindsModule.class}) | ||
interface MultibindsComponent { | ||
UsesInaccessible usesInaccessible(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
compiler/src/it/functional-tests/src/main/java/test/multipackage/a/AMultibindsModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (C) 2015 The Dagger 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 | ||
* | ||
* http://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. | ||
*/ | ||
|
||
package test.multipackage.a; | ||
|
||
import dagger.Module; | ||
import dagger.multibindings.Multibinds; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
/** A module that {@code @Multibinds} a set and a map of {@link Inaccessible}. */ | ||
@Module | ||
public abstract class AMultibindsModule { | ||
@Multibinds | ||
abstract Set<Inaccessible> inaccessibleSet(); | ||
|
||
@Multibinds | ||
abstract Map<String, Inaccessible> inaccessibleMap(); | ||
} |
23 changes: 23 additions & 0 deletions
23
compiler/src/it/functional-tests/src/main/java/test/multipackage/a/Inaccessible.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (C) 2016 The Dagger 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 | ||
* | ||
* http://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. | ||
*/ | ||
|
||
package test.multipackage.a; | ||
|
||
import javax.inject.Inject; | ||
|
||
final class Inaccessible { | ||
@Inject Inaccessible() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.