Code Monkey home page Code Monkey logo

Comments (8)

mikehardy avatar mikehardy commented on May 19, 2024 1

I am sure this is possible - probably a trivial change to the script if you have time to try it? I'm pretty busy today on a bunch of repositories today with big userbases just doing user education and don't have time for enhancements at the moment - the changes are easy but to test it and make sure takes a little more time (not much but...)

from jetifier.

cawfree avatar cawfree commented on May 19, 2024 1

Hey, absolutely I'll gladly take a look. Unfortunately bash isn't exactly my speciality, but I'll try to do a little reading around it and see if I can come up with something.

Thanks again!

from jetifier.

cawfree avatar cawfree commented on May 19, 2024

Thanks for this great tool @mikehardy!

Just to add to this, I wonder if it would be possible to avoid processing any file contents which like under app/build/ directories, since these intermediate results could just be re-populated after making a new build. Might be a quick gain.

from jetifier.

jgreen210 avatar jgreen210 commented on May 19, 2024

It'll generally only be a relatively minor improvement, but could use find's -prune option for .git directories. This would avoid scanning all the files in these directories.

from jetifier.

jgreen210 avatar jgreen210 commented on May 19, 2024

sed's -i option takes a '' value, which would prevent creation of backup files, wouldn't need to delete them. Could then use find -exec sed -i '' -f "${MAPPING_SED}" '{}' '+'. That might be a little quicker, and would work better for paths with spaces etc.

from jetifier.

jgreen210 avatar jgreen210 commented on May 19, 2024

I got decent speed here by only applying the large list of replacements to a line if it includes the substring "android.support". sed is probably quicker than most scripting languages, but not if it has to loop through many patterns for every line. Apologies for not posting the script, I'd have to jump through some hoops with our legal department to do that.

from jetifier.

mikehardy avatar mikehardy commented on May 19, 2024

@jgreen210 I think it already discards the .git directories but maybe prune is a more efficient way. The -i pointer sounds interesting but I had a lot of compatibility issues with BSD sed on macOS and went back and forth on it. Going to stay with how it is now. Maybe you could just post the bit that is the improvement? take + give :-)

from jetifier.

mikehardy avatar mikehardy commented on May 19, 2024

Resolved with #5 but if someone posted the sed-kung-fu (or a pointer to it) to skip replacement checking if android.support wasn't on a line, that would be awesome

from jetifier.

Related Issues (20)

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.