Skip to content

Instantly share code, notes, and snippets.

View m4kvn's full-sized avatar
🐔
Hahsibiroko Kawai

m4kvn m4kvn

🐔
Hahsibiroko Kawai
View GitHub Profile
@m4kvn
m4kvn / MainActivity.kt
Created August 13, 2019 09:12
リソースを取得する際の処理速度について調査
package com.github.m4kvn.resource.resourceaccesstest
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.updatePadding
import kotlinx.android.synthetic.main.activity_main.*
import java.util.concurrent.atomic.AtomicLong
import java.util.concurrent.atomic.AtomicReference
class MainActivity : AppCompatActivity() {
@m4kvn
m4kvn / merge_junit_results.py
Created July 11, 2019 01:25 — forked from cgoldberg/merge_junit_results.py
Merge multiple JUnit XML results files into a single results file.
#!/usr/bin/env python
"""Merge multiple JUnit XML results files into a single results file."""
# MIT License
#
# Copyright (c) 2012 Corey Goldberg
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
plugins {
id("com.android.library")
kotlin("android")
}
android { common() }
dependencies { submodule() } // SubModule用の依存関係を読み込む
plugins {
id("com.android.application")
kotlin("android")
}
android {
common()
defaultConfig {
applicationId = "com.m4kvn.myapplication"
versionCode = 1
versionName = "1.0.0"
// implementation用のメソッドを作っておくと便利
fun DependencyHandler.implementation(dependency: Any) {
add("implementation", dependency)
}
fun DependencyHandler.testImplementation(dependency: Any) {
add("testImplementation", dependency)
}
fun DependencyHandler.kapt(dependency: Any) {
plugins {
id("com.android.library")
kotlin("android")
}
android { common() }
plugins {
id("com.android.application")
kotlin("android")
}
android {
common()
defaultConfig {
applicationId = "com.m4kvn.myapplication"
versionCode = 1
versionName = "1.0.0"
@m4kvn
m4kvn / BuildExt.kt
Last active February 25, 2019 08:04
fun BaseExtension.common() {
compileSdkVersion(Versions.compileSdk)
buildToolsVersion = Versions.buildTools
defaultConfig {
minSdkVersion(Versions.minSdk)
targetSdkVersion(Versions.targetSdk)
multiDexEnabled = true
}
}
@m4kvn
m4kvn / error
Created February 25, 2019 08:04
com.android.build.gradle.LibraryExtension_Decorated cannot be cast to com.android.build.gradle.internal.dsl.BaseAppModuleExtension
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)</li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)</li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
plugins {
id("com.android.application")
kotlin("android")
}
androidCommon()
android {
defaultConfig {
applicationId = "com.m4kvn.myapplication"