https://github.com/stephanenicolas/injectresource
Inject resources automatically on Android.
https://github.com/stephanenicolas/injectresource
Last synced: 9 months ago
JSON representation
Inject resources automatically on Android.
- Host: GitHub
- URL: https://github.com/stephanenicolas/injectresource
- Owner: stephanenicolas
- License: apache-2.0
- Created: 2014-08-23T23:48:35.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-30T14:54:22.000Z (over 11 years ago)
- Last Synced: 2025-03-25T10:11:48.778Z (10 months ago)
- Language: Java
- Size: 4.12 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
InjectResource [](https://maven-badges.herokuapp.com/maven-central/com.github.stephanenicolas.injectresource/injectresource-plugin)
==========
***Injects resources automatically.***

###Usage
Inside your `build.gradle` file, add :
```groovy
apply plugin: 'injectresource'
```
And now, annotate every resource you want to inject.
```java
public class MainActivity extends Activity {
@InjectResource(R.string.foo) private String fooResource;
}
```
###Example
You will find an example program in the repo.
###How does it work ?
Thanks to
* [morpheus](https://github.com/stephanenicolas/morpheus), byte code weaver for android.
* [AfterBurner](https://github.com/stephanenicolas/afterburner), byte code weaving swiss army knife for Android.
### Related projects
On the same principle of byte code weaving :
* [InjectView](https://github.com/stephanenicolas/injectview)
* [InjectExtra](https://github.com/stephanenicolas/injectextra)
* [LogLifeCycle](https://github.com/stephanenicolas/loglifecycle)
* [Hugo](https://github.com/jakewharton/hugo)
### CI
[](https://travis-ci.org/stephanenicolas/injectresource)
[](https://coveralls.io/r/stephanenicolas/injectresource)
License
-------
Copyright (C) 2014 Stéphane NICOLAS
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.