Code Monkey home page Code Monkey logo

enhance's Introduction

Enhance!

Command line utility to process Android source files distributed via SDK manager and add API version information as javadoc tags:

/**
 * Called by the system when the activity changes from fullscreen mode to multi-window mode and
 * visa-versa.
 *
 * @see android.R.attr#resizeableActivity
 * @param isInMultiWindowMode True if the activity is in multi-window mode.
 * @deprecated Use {@link #onMultiWindowModeChanged(boolean, Configuration)} instead.
 * @since 7.0 Nougat (24)
 * @deprecated 8.0 Oreo (26)
 */
@Deprecated
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
    // Left deliberately empty. There should be no side effects if a direct
    // subclass of Activity does not call super.
}

Ironically allows to actually format processed code with AOSP code style specification (and as google-java-format is used - GOOGLE style is also supported).


Pick the jar file from the latest release.

There are few configuration options:

  • sdk: (required) Android SDK version (for example 25)
  • format: Allows to format processed Java source files. Available options are: aosp and google. Everything else (including empty argument) won't format processed code
  • sp: path to Android SDK
usage: Enhance
 -format <arg>          Format sources. Accepts (aosp|google). Everything
                        else would keep original formatting
 -h,--help              Prints help
 -sdk <arg>             Specify which SDK version to process.
 -sp,--sdk-path <arg>   Path to Android SDK. If not specified
                        'ANDROID_HOME' system variable will be used

Please note that you Android SDK folder must already contain sources for specified sdk version.

So, usage would be like that:

# just add api information to source code, no formatting
java -jar enhance.jar -sdk 26

# also format with AOSP
java -jar enhance.jar -sdk 26 -format aosp

# or GOOGLE
java -jar enhance.jar -sdk 26 -format google

# or with custom SDK path
java -jar enhance.jar -sdk 26 -sp "/Users/not_me/android/sdk"

If you would like to restore unmodified copy of source code you can find it: {your-home-directory}/.enhance-backup/android-{sdk}

Thanks

Big kudos to the maintainers of amazing javaparser!

License

  Copyright 2018 Dimitry Ivanov ([email protected])

  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.

enhance's People

Watchers

 avatar

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.