본문 바로가기
[Gradle] compile(api) vs. implementation [Gradle] compile(api) vs. implementation -gradle 3.0 이 나오면서 compile 은 deprecated 되었고, implementation 또는 api 를 써야 한다. -api dependency는 consumer 에게 library 가 노출이 되어, consumer 의 classpath 에 포함이 된다.implementation 은 consumer 에게 노출되지 않아, compile classpath 에 들어가지 않는다. -implementation 의 장점은 아래와 같다. dependency 가 compile classpath 에 들어가지 않아서 transitive dependency 를 실수로 depend 하지 않는다.더 빠른 compile 이 가능하다.de.. 2019. 2. 6.
[android] Robolectric tutorial [android] Robolectric tutorial http://robolectric.org/ Introduction -test 를 android emulator 나 device 에서 하는 것은 느리다.이 환경에서는 TDD 를 이루기 어렵다. Robolectric 은 unit test framework 로 android sdk jar 를 복제&확장해서 TDD 를 가능하도록 돕는다.JVM 에서 android 코드를 테스트 할 수 있다. -@RunWith(RobolectricTestRunner.class) public class MyActivityTest { @Test public void clickingButton_shouldChangeResultsViewText() throws Exception { .. 2018. 12. 8.
[android] Gradle Tutorial #2 Dependency, Android Libraries and Multi-project setup -external library jar 를 사용하려면 compile configuration 을 사용하면 된다. dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) // api 와 implementation 으로 바뀌었다.} android { ...} -compile 은 main app 을 compile 한다.compile 되는 모든 것은 compile classpath 로 잡히고, final APK 에 포함이 된다. 다음과 같은 compile configuration 을 추가할 수 있고,buildType 을 추가하면 자동으로 compile 이 .. 2018. 10. 5.
[SQLite3] 03. SQL 고급 #1 [SQLite3] 03. SQL 고급 #1 이 글은 "빠르게 활용하는 모바일 데이터베이스 SQLite3” 이란 글을 보며 필요한 내용만 정리한 글입니다.자세한 내용은 책을 구매해서 보세요 1. 관계형 데이터베이스 설계 -한 개의 Table 에 모든 정보를 담는 경우 다음과 같은 단점이 있다. 중복되는 정보가 저장된다. 레코드 간 구분 가능한 필드가 명확히 없다. ( Property 가 거의 같은 경우 ) -RDBMS 의 설계 원칙은 중복을 최소화하는 것이다.데이터 중복성(redundancy)과 일관적이지 않은 데이터 종속성(dependency)를 제거하는 규칙에 따라 정보를 여러 테이블에 저장되도록 테이블을 설계하고, 테이블간 공통된 값으로 서로 연결되게 한다. -테이블의 각 행을 구분하는 하나 이상의 .. 2018. 5. 18.
[android] Dependency conflict 해결하기 -아래 명령을 통해 dependency 와 그 버전을 확인 할 수 있다.만약 2개의 library 가 같은 lib 그러나 version 이 다른 dependency 를 가지고 있다면 highest dependency 를 가져간다../gradlew dependencies -같은 build variable 에 대해 공통의 dependency 가 있다면 위의 규칙을 따르지만,다른 build variable 에 대해서는 dependency conflict 가 발생 할 수 있다.예를 들면 compile 과 androidTestCompile 에 사용되는 lib 이 다른 version 을 가르킬 때이다. 이 경우 다음과 같이 dependency 를 제거할 수 있다. 1. 한 dependency 에서 conflict .. 2018. 3. 15.
[android] library 를 dependency 에 명시할 수 있게 배포하기 [android] library 를 dependency 에 명시할 수 있게 배포하기 https://medium.com/dualcores-studio/make-an-android-custom-view-publish-and-open-source-99a3d86df228#.5v8a0pl9i1. JFrog Bintary 에 가입하고 로그인하라 https://bintray.com/ 2. Profile page 에 가서 Repository, Package, 그리고 Version 을 만들라. Package 는 Github 와 연동되어 땡겨오는 UI 가 제공된다. 3. aar 파일을 생성해서 upload 하라. https://github.com/blundell/release-android-library 를 사용하여 이를.. 2018. 3. 11.
[Objective-C] 병렬 프로그래밍 [Objective-C] 병렬 프로그래밍 출처 : OS X 구조를 이해하면서 배우는 Objective-C Chap 19. 19.1. 멀티 스레드 * 19.1.1. 스레드의 기본 개념 -스레드(thread)란 프로세스(process)안에서 CPU 이용권을 가진 가상적인 실행 단위이다.일반적으로 하나의 프로세스에는 하나의 스레드밖에 없지만 복수의 스레드를 생성해 프로세스 안에서 병렬로 동작시킬 수도 있다. -프로그램 실행이 시작될 때부터 동작하는 스레드를 메인 스레드라 하고 그 외에 나중에 생성된 스레드를 세컨더리 스레드(secondary thread) 또는 서브 스레드(subthread)라고 한다. -부모 스레드는 자식 스레드의 실행이 끝나길 기다렸다 합류(join)할 수 있다.대다수의 스레드 구현은 따로.. 2018. 1. 10.
[Kotlin] Kotlin 은 Compile time 이 느리다는데.. 사실일까? [Kotlin] Kotlin 은 Compile time 이 느리다는데.. 사실일까? https://medium.com/keepsafe-engineering/kotlin-vs-java-compilation-speed-e6c174b39b5d -위 글을 쓴 필자는 Java base 로 되어 있는 출시된 앱을 전부 Kotlin 으로 전환하여 자신만의 Compile time 을 측정해보았다. -테스트 환경 및 조건 #1 빌드는 총 10번 연속으로 돌려서 평균값 산출Hardware 는 i7-6000 3.4GHz, 32G DDR4, Samsung 850 Pro SSD, Gradle 2.14.1 빌드시마다 매번 clean build or notGradle daemon 사용 or not코드 변경 유무 -Clean bui.. 2017. 9. 26.
[Kotlin Tutorial] Building Kotlin projects [Kotlin Tutorial] Building Kotlin projects 참조 : Kotlin in action 1. Building Kotlin code with gradle -Kotlin 을 사용하는데 추천되는 build system 은 gradle 이다.gradle 은 incremental build 를 사용해서 빌드 속도도 빠르게 할 수 있고,gadle daemon 이 있어 build process 도 오래 살아있고, 기타 고급 기술들이 들어가 있다. cf) incremental build 는 빌드된 구성 요소 중 최신 상태인 구성 요소는 다시 빌드하지 않는 것을 이야기한다.즉 빌드된 적 없는 대상이나 만료된 대상만 다시 빌드하는 빌드방식을 incremental build 라 부른다. -Gra.. 2017. 9. 18.
반응형