How does CocoaPods work

CocoaPods does a whole lot behind the scenes to make everything you’re talking about work. On a relatively high level the actual ‘Pods’ are managed in a repo that lives on Github here. This is where 3rd party library vendors submit their ‘Pods’ to work with CocoaPods. You’ll notice that if you search for a … Read more

Dependency Injection vs Service Location

Because the class is now being injected with an IoC container, then why not use it to resolve all other dependencies too? Using the service locator pattern completely defeats one of the main points of dependency injection. The point of dependency injection is to make dependencies explicit. Once you hide those dependencies by not making … Read more

Gradle Test Dependency

You can expose the test classes via a ‘tests’ configuration and then define a testCompile dependency on that configuration. I have this block for all java projects, which jars all test code: task testJar(type: Jar, dependsOn: testClasses) { baseName = “test-${project.archivesBaseName}” from sourceSets.test.output } configurations { tests } artifacts { tests testJar } Then when … Read more

Force re-download of release dependency using Maven

You cannot make Maven re-download dependencies, but what you can do instead is to purge dependencies that were incorrectly downloaded using mvn dependency:purge-local-repository See: http://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html This looks up the list of all transitive dependencies of the current project, deletes them, then redownloads them. You can even add it as a plugin into your pom if … Read more

Dealing with “Xerces hell” in Java/Maven?

There are 2.11.0 JARs (and source JARs!) of Xerces in Maven Central since 20th February 2013! See Xerces in Maven Central. I wonder why they haven’t resolved https://issues.apache.org/jira/browse/XERCESJ-1454… I’ve used: <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.11.0</version> </dependency> and all dependencies have resolved fine – even proper xml-apis-1.4.01! And what’s most important (and what wasn’t obvious in the … Read more

Javascript require() function giving ReferenceError: require is not defined

RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments, like Rhino and Node. Using a modular script loader like RequireJS will improve the speed and quality of your code. IE 6+ ………. compatible ✔ Firefox 2+ ….. compatible ✔ Safari 3.2+ … Read more