-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jb/initial lib #1
Conversation
gradle/dependencies.gradle
Outdated
|
||
def build = [ | ||
androidPlugin : "com.android.tools.build:gradle:3.1.0", | ||
buildToolsVersion : "27.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't be necessary to specify this anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildToolsVersion is for the sample app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still shouldn't be necessary, AGP sets it on its own
gradle/dependencies.gradle
Outdated
] | ||
|
||
def build = [ | ||
androidPlugin : "com.android.tools.build:gradle:3.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.1.4 is the latest stable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gradle/dependencies.gradle
Outdated
*/ | ||
|
||
def versions = [ | ||
kotlin : "1.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not 1.2.60?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had copied from artist. 49ae0be
gradle/dependencies.gradle
Outdated
gradleAptPlugin : "net.ltgt.gradle:gradle-apt-plugin:0.15", | ||
gradlePluginsUrl : "https://plugins.gradle.org/m2/", | ||
minSdkVersion : 16, | ||
targetSdkVersion : 27 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libraries shouldn't specify this (unless it's for the sample)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the sample
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok 👍
gradle/dependencies.gradle
Outdated
def test = [ | ||
compileTesting : "com.google.testing.compile:compile-testing:0.11", | ||
junit : 'junit:junit:4.12', | ||
robolectric : "org.robolectric:android-all:8.1.0-robolectric-4402310", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version looks...weird?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed in 49ae0be. don't think i'll need it
stylist/build.gradle
Outdated
@@ -0,0 +1,16 @@ | |||
apply plugin: "org.jetbrains.kotlin.jvm" | |||
|
|||
sourceCompatibility = JavaVersion.VERSION_1_7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another place that could be java 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sample/library/build.gradle
Outdated
check.dependsOn 'checkstyle' | ||
|
||
dependencies { | ||
api deps.support.appcompat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: implementation
since it's an app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
task checkstyle(type: Checkstyle) { | ||
source 'src' | ||
include '**/*.java' | ||
exclude '**/gen/**' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crazy idea - might be worth enabling this on generated code to make sure you're generating valid/well-formed xml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
between aapt2 and integration tests to be added in #4 we should already be sufficiently covered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant more to be readable
apply plugin: 'net.ltgt.apt' | ||
apply plugin: "java-library" | ||
|
||
sourceCompatibility = JavaVersion.VERSION_1_7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be java 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
); | ||
|
||
private StyleItemGroup textSizes = new StyleItemGroup( | ||
new StyleItem("textSizeSmall", "12dp"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind think it'd be really good to make the API more pedantic like java/kotlinpoet do. making a sealed class of the types (value, attr, or reference) and make the API more idiomatic to read
DimensionItem("textSizeSmall", 12, Dimen.DP) // Value (can be a nicer form to achieve the next line)
DimensionItem("textSizeSmall", ValueReference("12dp")) // Value
DimensionItem("textSizeSmall", DimensionReference("textSizeTooSmall")) // Reference - to `@dimen/textSizeTooSmall`. Could take an optional namespace arg too
DimensionItem("textSizeSmall", AttrReference("textSizeTooSmall")) // Attr - to `?textSizeTooSmall`. Could take an optional namespace arg too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to investigate this more in #7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but definitely keen to see where #7 goes
This PR contains the initial creation of this library. It contains the forked, cleaned up, and namespaced copy of resources-poet in addition to the api, core, and top-level modules of the stylist library. A sample providers module and library module are also included, but will be used in a sample app in a followup PR.