GithubHelp home page GithubHelp logo

api-evolution-demo's Introduction

Gradle

Revved up by Develocity CII Best Practices

Gradle is a build tool with a focus on build automation and support for multi-language development. If you are building, testing, publishing, and deploying software on any platform, Gradle offers a flexible model that can support the entire development lifecycle from compiling and packaging code to publishing websites. Gradle has been designed to support build automation across multiple languages and platforms, including Java, Scala, Android, Kotlin, C/C++, and Groovy, and is closely integrated with development tools and continuous integration servers, including Eclipse, IntelliJ, and Jenkins.

For more information, please visit the official project homepage

Getting Started

Stay in Flow

Enjoy first-class Gradle support in your IDE of choice.

Need Help?

Contributing

If you're looking to contribute to Gradle or provide a patch/pull request, you can find more info here.

This project adheres to the Gradle Code of Conduct. By participating, you are expected to uphold this code.

api-evolution-demo's People

Contributors

donat avatar lptr avatar tylerbertrand avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-evolution-demo's Issues

Method replacement: handle replacing super calls ('INVOKESPECIAL')

Consider upgrading this:

class Client extends Server {
    @Override
    String getTestProperty() {
        return super.getTestProperty() + "-overridden"
    }

    @Override
    void setTestProperty(String value) {
        super.setTestProperty("overridden-" + value)
    }
}

When replacing a call like super.setProperty(), the JVM bytecode instruction used is INVOKESPECIAL instead of INVOKEVIRTUAL. Let's handle this use case and add some tests.

Replace type

Like move types from one package to another for example.

Making thrown exceptions more general is another example.

Refactor testing the bytecode upgrades

Currently testing works by executing *Client.main(). This was good for testing the basic functionality, but now we would need more fine-grained test logic. Figure out a way to have some nice syntax over upgraded classes.

Allow decorating `System.getProperties()`

This is a special replacement already implemented by gradle/gradle in InstrumentingTransformer. We need to have this functionality working if we want to use this tool in Gradle itself.

Method replacement: add typed method replacers

Currently when replacing a method there is very little type information exposed at registration. We could make it harder to write invalid code by adding replacement builders that work with type information about arguments and the return type.

Fix `double` parameter handling for dynamic Groovy

Dynamic Groovy converts double parameters to BigDecimal internally. This causes the following exception to be thrown when this code is uncommented:

// TODO Fix this, apparently Groovy sends double values over as BigDecimal
// doSetDouble(server)
// println doGetDouble(server)

java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Double
	at org.gradle.demo.api.evolution.ApiUpgradeManager.lambda$addSetterReplacement$2(ApiUpgradeManager.java:110)
	at org.gradle.demo.api.evolution.MethodReplacement$1.call(MethodReplacement.java:125)
	at org.gradle.demo.api.evolution.DynamicGroovyClient.doSetDouble(DynamicGroovyClient.groovy:40)
	at org.gradle.demo.api.evolution.DynamicGroovyClient.main(DynamicGroovyClient.groovy:11)
	at org.gradle.demo.api.evolution.PropertyUpgradeTest.dynamic Groovy client works(PropertyUpgradeTest.groovy:37)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.