Skip to content
Permalink
Branch: master
Commits on Feb 23, 2019
  1. Enable incremental AnnotationProcessing (#483)

    pavlospt authored and facebook-github-bot committed Feb 23, 2019
    Summary:
    This PR handles required changes to make Litho compatible with Gradle incremental annotation processing.
    
    * Add originating element when creating a `*SpecModel`.
        * This is required, in order to pass it on the `TypeSpec` that in turn forwards those to `Filer API`.
    * Add relevant Gradle META-INF file that specify which annotation processors support incremental AP and what is their type. (I explicitly left out any `*TestingProcessor` in order to avoid any false alarms when running tests)
    
    I did some manual tests and it seems that there is indeed a performance improvement between this branch and `master`, but I am not quite sure if I am biased or this is working in reality. I have some screenshots indicating that less tasks were executed for the same changes between `pavlospt:master` (rebased on latest `litho:master`) and `pavlospt:incremental_annotation_processing`.
    
    ![Java changes on `master`](https://user-images.githubusercontent.com/1070871/51906479-dbd54b00-23cc-11e9-8349-63259fcffd6f.png)
    
    ![Java changes on `incremental_annotation_processing`](https://user-images.githubusercontent.com/1070871/51906511-eabbfd80-23cc-11e9-8a01-79ec36cb0c83.png)
    
    I am not sure if this can be tested. Other implementations of IAP i have found around, are making use of a `Map` inside the `Processor` and return the `orginatingElement` from an equivalent method there. Essentially they test the existence of an element's FQCN in the `Map`.
    
    The way I implemented the current solution, is just by taking advantage of `TypeSpec` 's ability to hold an `originatingElement` which then passes it to the `Filer API`. I guess we can trust Square's tests for this 😄
    
    Addresses issue #482
    Pull Request resolved: #483
    
    Reviewed By: IanChilds
    
    Differential Revision: D13859682
    
    Pulled By: passy
    
    fbshipit-source-id: d4c5eaa1d65385227b259f3e471d9a0467284cc0
Commits on Jan 21, 2019
  1. Upgrade to Gradle 5.1.1 stable version (#478)

    pavlospt authored and facebook-github-bot committed Jan 21, 2019
    Summary:
    * Bump Gradle version to 5.1.1 stable
    * Bump Kotin version to 1.3.11
    * Update test resources copy task for Gradle 5.0+
    
    Closes #465
    
    ![image](https://user-images.githubusercontent.com/1070871/51391096-d3ae1d80-1b39-11e9-9350-55a74ad6fb69.png)
    
    ![image](https://user-images.githubusercontent.com/1070871/51391113-e0327600-1b39-11e9-99da-7734844e23af.png)
    Pull Request resolved: #478
    
    Reviewed By: muraziz
    
    Differential Revision: D13732137
    
    Pulled By: passy
    
    fbshipit-source-id: 6a515aa37808ac7d011e75ccfabf6c9b0006f76e
Commits on Oct 3, 2018
  1. Migrate to CircleCI 2.1 configuration (#439)

    pavlospt authored and facebook-github-bot committed Oct 3, 2018
    Summary:
    Hey all 😄 In light of Hacktoberfest and recent CircleCI updates here is a PR to review at your disposal :)
    
    * Updates CircleCI config to 2.1
    * Fixes several issues in CircleCI current configuration
    
    * The owner of the project needs to follow some simple steps in order to enable `Build processing` feature needed for config 2.1. Go to CircleCI website -> Project: `litho` -> Click on settings icon -> `Advanced Settings` -> Scroll to bottom -> Toggle `Enable build processing` to `on`.
    
    * Until the above is enabled the build will fail :/ The file itself is validated using `circleci config validate .circleci/config.yml` and you can find an execution using the new configuration here: https://circleci.com/workflow-run/c51dad46-9606-4001-9077-0eecc112bf89
    
    CircleCI config 2.1 introduces a more formal way of re-using several parts in the project's configuration, such as executors & commands. This lets us minimize the bloat of the config by re-using commands (with params when needed). More on this can be found here: https://circleci.com/docs/2.0/reusing-config/
    Pull Request resolved: #439
    
    Differential Revision: D10161258
    
    Pulled By: passy
    
    fbshipit-source-id: 3addd62561d1b73b9df4a0c3b14578256adcba0a
Commits on Jul 1, 2018
  1. Update kotlin-stdlib-jre7 to kotlin-stdlib-jdk7 (#393)

    pavlospt authored and facebook-github-bot committed Jul 1, 2018
    Summary:
    * Kotlin JRE7 dependency has been deprecated and replaced with JDK7 version.
    Closes #393
    
    Differential Revision: D8702231
    
    Pulled By: passy
    
    fbshipit-source-id: fa22365307cc5b7956c688d0b2bb155604567b33
Commits on Jun 30, 2018
  1. Return Map instead of MutableMap on SampleComponentsLogger (#394)

    pavlospt authored and facebook-github-bot committed Jun 30, 2018
    Summary:
    * Probably this was caused from a Java to Kotlin conversion. Since Kotlin
    also has Map we could return an immutable Map instead of a Mutable :)
    Closes #394
    
    Differential Revision: D8709376
    
    Pulled By: passy
    
    fbshipit-source-id: 99c102605a942d6d705c13bd1ea472fd39061249
Commits on Jun 18, 2018
  1. Throw when using 'isFullSpan()' in ViewRenderInfo.Builder (#387)

    pavlospt authored and facebook-github-bot committed Jun 18, 2018
    Summary:
    * Since `ViewRenderInfo.Builder` extends `BaseRenderInfo.Builder` it provides access to `builder.isFullSpan(boolean)`, which does not have any effect for `ViewRenderInfo`.
    
    * See #312 for more details.
    Closes #387
    
    Reviewed By: IanChilds
    
    Differential Revision: D8476810
    
    Pulled By: passy
    
    fbshipit-source-id: fee087ea38569d85c8a59b181fcca1aab5cfaba8
Commits on Jun 16, 2018
  1. Bump Kotlin version to 1.2.50 stable (#386)

    pavlospt authored and facebook-github-bot committed Jun 16, 2018
    Summary:
    * Bumps Kotlin version to 1.2.50 stable.
    
    `sample-kotlin` builds successfully on that version.
    Closes #386
    
    Differential Revision: D8466596
    
    Pulled By: passy
    
    fbshipit-source-id: d6095fac93b9e16886ff8dff2ffec5c79129f40a
Commits on Jun 14, 2018
  1. Port 'bordereffects' to 'sample-kotlin' (#380)

    pavlospt authored and facebook-github-bot committed Jun 14, 2018
    Summary:
    * Like previous PRs this one is porting 'bordereffects' to 'sample-kotlin' as well.
    Closes #380
    
    Reviewed By: passy
    
    Differential Revision: D8355340
    
    Pulled By: marco-cova
    
    fbshipit-source-id: a3550e2c1ff3a0c42c41158cb205dd0e10c86dac
Commits on Jun 11, 2018
  1. Allow EventData to return current instance (#383)

    pavlospt authored and facebook-github-bot committed Jun 11, 2018
    Summary:
    * Using `apply` function from Kotlin, we can have a Builder pattern-like behavior, allowing call chaining.
    Closes #383
    
    Differential Revision: D8351515
    
    Pulled By: passy
    
    fbshipit-source-id: aa84e12702523bb7be40db9cb48e103dca737ffb
Commits on Jun 9, 2018
  1. Optimize Workflow for performance (#382)

    pavlospt authored and facebook-github-bot committed Jun 9, 2018
    Summary:
    For some reason I had used the wrong Gradle command to pre-fetch dependencies (e.g.: `./gradlew dependencies`) and when reaching the `gradle_tests_run` Job in the Workflow, Gradle was downloading those dependencies every time.
    
    I copied the Gradle command used in passy 's Dockerfile of the previously used image, in order to trigger a dependencies fetch.
    Closes #382
    
    Differential Revision: D8343557
    
    Pulled By: passy
    
    fbshipit-source-id: 090545e043f93ccabd55b7ea333363afc8897663
Commits on Jun 4, 2018
  1. Port `animations` to `sample-kotlin`

    pavlospt authored and facebook-github-bot committed Jun 4, 2018
    Summary:
    This PR follows a similar path as the previous one :) It ports `animations` package from Java `sample` to Kotlin `sample-kotlin`.
    
    A nice side effect of it is that even more parts of the framework are being "tested" in Kotlin code, which will allow catching Kotlin-related issues earlier.
    Closes #379
    
    Reviewed By: muraziz
    
    Differential Revision: D8235929
    
    Pulled By: passy
    
    fbshipit-source-id: 420500d34e04fa5f078670bdf22f99e595ae9926
Commits on Jun 1, 2018
  1. Port `errors` into `sample-kotlin`

    pavlospt authored and facebook-github-bot committed Jun 1, 2018
    Summary:
    Part of this commit as well, is that I had to restructure `sample-kotlin` navigation like the one available in `sample`. It will make it easier to port Animations as well.
    Closes #375
    
    Reviewed By: muraziz
    
    Differential Revision: D8201274
    
    Pulled By: passy
    
    fbshipit-source-id: f645039b9daccdc94284161f8a78af839636fe5a
Commits on May 29, 2018
  1. Fix varArg builder methods for Kotlin

    pavlospt authored and facebook-github-bot committed May 29, 2018
    Summary:
    Due to Kotlin compiler applying wildcards on List types, there was an issue when generating from a Kotlin spec and using `varArg` Props.
    
    Easy fix was to annotate List type with `JvmSuppressWildcards` but just in case someone forgets to do it, this PR is taking care of handling it seamlessly, by removing wildcards iff generating from Kotlin specs.
    
    Addresses #373
    Closes #374
    
    Reviewed By: IanChilds
    
    Differential Revision: D8175861
    
    Pulled By: passy
    
    fbshipit-source-id: e442cebc8025c181e0678928db83c00b9f39eed9
Commits on May 25, 2018
  1. Fix PropDefault values extraction for Kotlin

    pavlospt authored and facebook-github-bot committed May 25, 2018
    Summary:
    * There was an issue with the current implementation if a user tried to use that same annotation prefixed with `get`.
    
    e.g.: `get:PropDefault`
    
    The solution is to identify which is the case and fallback to the respective method that holds the `PropDefault` annotation on the equivalent Java file.
    
    With `get:`
    
    ```java
       PropDefault(
          resType = ResType.DIMEN_SIZE,
          resId = 2131034112
       )
       Nullable
       public final Float getImageAspectRatio() {
          return imageAspectRatio;
       }
    ```
    
    Without `get:`
    
    ```java
       /** deprecated */
       // $FF: synthetic method
       PropDefault(
          resType = ResType.DIMEN_SIZE,
          resId = 2131034112
       )
       public static void imageAspectRatio$annotations() {
       }
    ```
    Closes #371
    
    Reviewed By: IanChilds
    
    Differential Revision: D8143186
    
    Pulled By: passy
    
    fbshipit-source-id: 820e0575c91a86cff25ac9094e6e4b97cdba172d
Commits on May 23, 2018
  1. Add Kotlin variant for LayoutSpec

    pavlospt authored and facebook-github-bot committed May 23, 2018
    Summary:
    Add Kotlin variant for `LayoutSpec`. More to follow 🎉
    Closes #365
    
    Reviewed By: marco-cova
    
    Differential Revision: D8116862
    
    Pulled By: passy
    
    fbshipit-source-id: 032c85200f46a696ca2b8cb4955eebd81b2953c9
Commits on May 21, 2018
  1. Prop default without @JvmField annotation

    pavlospt authored and facebook-github-bot committed May 21, 2018
    Summary:
    This PR generates a proper accessor for not `JvmField` annotated `PropDefaults`
    
    * Unfortunately this won't work if the `PropDefault` field gets annotated with `JvmField`. Did not find any workaround to it, since JvmField annotation is not forwarded on `PropModel`'s annotations/external annotations.
    
    * Addresses the last issue on #267
    Closes #362
    
    Reviewed By: IanChilds
    
    Differential Revision: D8070697
    
    Pulled By: passy
    
    fbshipit-source-id: a2cf26eed7dbda7a74ce0d604197ad638ca217dd
  2. Misc improvements

    pavlospt authored and facebook-github-bot committed May 21, 2018
    Summary:
    Fixed some mich issues:
    * Some formatting in Kotlin files
    * Update to Gradle 4.7 stable
    * Some "Kotlinizations"
    Closes #361
    
    Reviewed By: IanChilds
    
    Differential Revision: D8068794
    
    Pulled By: passy
    
    fbshipit-source-id: 3a7a1c0644d7edf7d136a8c28f1a60a9f38b3cb3
Commits on May 19, 2018
  1. Add sample-kotlin in repo-structure docs

    pavlospt authored and facebook-github-bot committed May 19, 2018
    Summary:
    Since `sample-kotlin` is now working properly, we can add in in `repo-structure.md` as well.
    Closes #363
    
    Differential Revision: D8069545
    
    Pulled By: passy
    
    fbshipit-source-id: ca7052ce3427c931528924cf780cf965eea07fd9
Commits on May 17, 2018
  1. Allow publish_snapshot job to run for master branch only

    pavlospt authored and facebook-github-bot committed May 17, 2018
    Summary:
    Currently, `publish_snapshot` runs for every commit which adds around 2-3 mins per `Workflow` run but then fails if the commit was not in `master`. Adding a filter on that Job allows it to shut down early instead of spending time restoring not needed caches, only to fail after.
    Closes #359
    
    Differential Revision: D8041354
    
    Pulled By: passy
    
    fbshipit-source-id: ec66a67a76945be5efd816ca595fb0ee500aee2f
Commits on May 16, 2018
  1. Restructure Circle CI config.yml to use Workflows

    pavlospt authored and facebook-github-bot committed May 16, 2018
    Summary:
    This PR leverages CircleCI Workflows in order to build samples & run tests in parallel.
    
    It first builds the whole project and then starts to run the following jobs in parallel:
    
    1) `sample` build with BUCK
    2) `sample-barebones` build with BUCK
    3) `sample-codelab` build with BUCK
    4) `sample-kotlin` build with Gradle
    5) `litho-it` tests run with BUCK
    6) `litho-it-powermock` tests run with BUCK
    7) Tests run with Gradle
    
    Every job that runs tests, also stores test results and artifacts. Note on this, the previous `regex` used was not grepping tests results from `litho-it` & `litho-it-powermock`. In order to save those results as well, I modified the jobs that run tests using `BUCK` to output the results in a `*.xml` file respectively.
    
    * Declare any references to be used in following steps
    * Declare Jobs that will run in Workflow
      -  Each Job consists of:
         - Container Configuration
         - Workspace attaching
         - Cache restoration
         - Main work execution (checkout code/build/test runs)
         - Store tests results (optional)
         - Store tests artifacts
    * Declare the Workflow alongside Jobs execution order and Jobs inter-dependencies
    
    * Currently `Workflow` is based on passy 's Docker image specially created for `Litho`:
    1) Based on `circle-ci-android` Docker image
    2) Installs `BUCK`
    3) Installs `androidSdk`
    4) Warms up some caches in order to reduce build time on the first job.
    
    Although this is great, Circle CI caches images on `containers` so it was pretty hard to end up on a container with that specific Docker image cached. It did happen though a few times (luckily enough there were some times I needed quick feedback loop and the container had the image cached), effectively letting the Job setup the environment in 1 second.
    
    By switching to `circle-ci-android` Docker image and pulling inside a configuration job, that would of course run as a first Job in the `Workflow` would drammatically increase our chances to find a cached Docker image and decrease the 5-6 mins of environment setup to 1 second. Considering the number of jobs in the `Workflow` (10 atm) it can help reduce the average completion time at an order of magnitude 😃
    
    * It took me around 3 days or so 🕵️
    * Ultimately final working version in my branch on my fork consisted of 59 fixup commits 😂
    * It took 269 job runs to finally get it to work 😮
    * Average `Workflow` run is 40 mins (will explain below some tips that can improve the time) 
    * CI provisioning is a tough task 😂
    
    ![Cached image inside container](https://user-images.githubusercontent.com/1070871/39297768-10c17ad8-494d-11e8-8884-a420b9fb8e72.png)
    
    ![Final success Workflow run](https://user-images.githubusercontent.com/1070871/39297781-16b11a8e-494d-11e8-9f93-cc8ae944e654.png)
    Closes #350
    
    Reviewed By: IanChilds
    
    Differential Revision: D7966601
    
    Pulled By: passy
    
    fbshipit-source-id: 0f7601850d542f32dfae0fc0a1929dcde3dc32c4
Commits on Apr 25, 2018
  1. Add Component.Builder variant method

    pavlospt authored and facebook-github-bot committed Apr 25, 2018
    Summary:
    * Adds method in `ComponentRenderInfo.Builder` that accepts a `Component.Builder`.
    
    Closes #89
    Closes #347
    
    Differential Revision: D7757195
    
    Pulled By: IanChilds
    
    fbshipit-source-id: 5899af0b27897d26286ff7b2b9d7fd191ea201f1
Commits on Apr 24, 2018
  1. Pass View in onLongClick() for LongClickableSpan

    pavlospt authored and facebook-github-bot committed Apr 24, 2018
    Summary:
    Resolves #338
    Closes #339
    
    Reviewed By: muraziz
    
    Differential Revision: D7743056
    
    Pulled By: passy
    
    fbshipit-source-id: d38d3d3b017431b23d76e923dfc2a9197c8800c2
Commits on Apr 17, 2018
  1. Transfer external Annotations on Component fields

    pavlospt authored and facebook-github-bot committed Apr 17, 2018
    Summary:
    * Builder methods were already including external Annotations
    for each Prop. Followed a same approach to transfer them on the Component
    fields as well.
    
    Closes #343
    Closes #344
    
    Reviewed By: IanChilds
    
    Differential Revision: D7652411
    
    Pulled By: passy
    
    fbshipit-source-id: 7c0d664af7b3ed958f5ccffaf2f01ebd3b8c6358
Commits on Apr 13, 2018
  1. Showcase usage of ViewRenderInfo (round 2)

    pavlospt authored and facebook-github-bot committed Apr 13, 2018
    Summary:
    Revives pasqualeanatriello 's #293 PR
    
    * Fix compilation issues
    * Rebase with `origin/master`
    * Fix commit messages
    Closes #340
    
    Reviewed By: muraziz
    
    Differential Revision: D7615096
    
    Pulled By: passy
    
    fbshipit-source-id: 852d203de7b6ae4af57961e9ebbf779d846a6c03
Commits on Mar 14, 2018
  1. Fix minor typo

    pavlospt authored and facebook-github-bot committed Mar 14, 2018
    Summary: Closes #331
    
    Differential Revision: D7277351
    
    Pulled By: passy
    
    fbshipit-source-id: 752abea0e69c63c7f82efa8a8aaf62d760538317
Commits on Nov 28, 2017
  1. Generate *Sp methods for Props

    pavlospt authored and facebook-github-bot committed Nov 28, 2017
    Summary:
    According to #281 discussion, I introduce this as a quick fix.
    It can be resolved in the future with a more appropriate solution.
    Closes #282
    
    Differential Revision: D6425388
    
    Pulled By: IanChilds
    
    fbshipit-source-id: c04a1333dbb14062c0465f705bf74a00bf7be9b1
Commits on Nov 2, 2017
  1. Delay variable initialization

    pavlospt authored and facebook-github-bot committed Nov 2, 2017
    Summary:
    `propDefaultResType` & `propDefaultResId` were initialized before their actual usage. After their initialization, `extractFromMethod()` could still return without using them.
    Closes #268
    
    Differential Revision: D6220879
    
    Pulled By: passy
    
    fbshipit-source-id: e1d649b47fc553d93e8e8270b336894711908deb
Commits on Jun 5, 2017
  1. Support ResType on PropDefault annotation

    pavlospt authored and facebook-github-bot committed Jun 5, 2017
    Summary:
    Initial work on adding support for `ResType` on `PropDefault` ( #81 )
    
    I went with the solution of having the `Builder` initializing the Props that have a default value marked as ResType, instead of passing down the `ComponentContext` which I tried to implement but it was introducing a quite huge change.
    
    In order to reduce the review scope I have only added generation for `resolveDimenSizeRes()` and will add the rest before closing the PR, in order to have a naming and feature compliance agreement after the initial review. Also, I believe that after resolving the resource on a marked `PropDefault` we should generate resource helper methods like we do for `Prop`.
    
    Let me know what you think!
    
    /cc: emilsjolander
    
    P.S.: There is a big diff on the `ComponentImplGenerator` due to different Code Style, so If you could share the one you are using so that we could be aligned and reduce the diffs, would be great.
    Closes #174
    
    Reviewed By: passy
    
    Differential Revision: D5171855
    
    Pulled By: IanChilds
    
    fbshipit-source-id: 1d52389ce95b4694b6b8a1b8d95f50d334e9b2a3
Commits on May 3, 2017
  1. Add missing static modifier on updateCheckBox

    pavlospt authored and facebook-github-bot committed May 3, 2017
    Summary:
    Fixes #166
    Closes #167
    
    Differential Revision: D4993018
    
    Pulled By: passy
    
    fbshipit-source-id: a863366ba584834fae287e7d24102cd5757aa10c
Commits on May 2, 2017
  1. Fixes #151

    pavlospt authored and facebook-github-bot committed May 2, 2017
    Summary:
    Fixes #151 by getting only the `LayoutSpec` and `MountSpec` annotation classes for processing.
    Closes #165
    
    Differential Revision: D4985957
    
    Pulled By: IanChilds
    
    fbshipit-source-id: de80ecfa68fe9b2b2cc94c1f16925e0fdd5a4b01
Commits on Apr 20, 2017
  1. Update isSticky() with required parameter

    pavlospt authored and facebook-github-bot committed Apr 20, 2017
    Summary:
    `ComponentInfo` method `isSticky()` accepts a boolean parameter.
    Closes #107
    
    Differential Revision: D4921346
    
    Pulled By: passy
    
    fbshipit-source-id: ea1e2cac117e1f9973aeb798b8577b0e60155701
You can’t perform that action at this time.