Comments (5)
asMap
sounds good. 👍
The backstory is: I needed to simply access values
. Instead I had to iterate over keys and collect values. Although not too hard, it would be much simpler to use already available Map
methods. I could just add values()
method but I feel like this is just an example. I believe it would be handy to have full Map interface.
I think asMap
is a good compromise to have both. I like the idea.
from gradle-build-properties-plugin.
I was gonna do this simply by using @Delegate
annotation from groovy. With this, it is actually pretty simple change. Except for the defaults
. This forced me to have a wrapper implementation of a simple map.
But at the same time I realized that there is an ongoing work on #35. That's why I decided to wait for that to finish.
Also opened this issue for discussion.
from gradle-build-properties-plugin.
As discussed IRL the reason why the plugin defines Entries
as interface is to stay away from the mutability of the Map
contract. To ensure immutability then we expose just 3 methods:
boolean contains(String key)
Entry getAt(String key)
Enumeration<String> getKeys()
I've been thinking about this and I still don't like the idea of using map there just to use some extension on Entries
(I'm not worried about how hard or simple is to make Entries
implement Map
, but rather how this breaks the original idea of immutable set of lazy-evaluated entries).
We have 2 alternatives:
- manually add the missing extensions to
Entries
to provide all the convenience methods missing - expose a
Map<String, Entry> asMap()
method that can be used to tap into the collection extensions from groovy without breaking the original idea.
@devisnik thoughts on this?
from gradle-build-properties-plugin.
Looking forward to the PR 😛
from gradle-build-properties-plugin.
Addressed by #43
from gradle-build-properties-plugin.
Related Issues (20)
- Remove built-in `buildProperties.env`, expose utility instead
- Introduce automation script for releases from `gradle-static-analysis-plugin`
- Add utility to create `Entries` from project properties HOT 1
- Split `README` in multiple files HOT 4
- Remove support for Android `signingConfig` HOT 1
- Possibility to read properties file passed in command line HOT 10
- Support absolute paths for keystore file HOT 2
- Add description support to `BuildProperties` HOT 1
- Consolidate public API to create/fill entries HOT 1
- Remove `include` support for `FilePropertiesEntries` HOT 3
- Add the plugin to Gradle Plugin repository HOT 5
- Provide api to check whether entries contain a given key
- Create migration documentation HOT 2
- Clarify "using" syntax HOT 5
- Groovydoc is not being deployed HOT 1
- Unexpected fallback entries failure HOT 6
- sample app module build has missing quotes in plugin import declaration HOT 2
- Support for yaml HOT 5
- Moving away from jcenter() repo HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-build-properties-plugin.