code: public String getToolchain( File file ) throws MojoExecutionException
      {
          String resolvedNdkToolchain = null;
  
          // try to resolve the toolchain now
          String ndkArchitecture = file.getParentFile().getName();
          if ( ndkArchitecture.startsWith( "armeabi" ) )
          {
              resolvedNdkToolchain = resolveNdkToolchain( ARM_TOOLCHAIN );
          }
          else if ( ndkArchitecture.startsWith( "arm64" ) )
          {
              resolvedNdkToolchain = resolveNdkToolchain( ARM64_TOOLCHAIN );
          }
          else if ( ndkArchitecture.startsWith( "x86_64" ) )
          {
              resolvedNdkToolchain = resolveNdkToolchain( X86_64_TOOLCHAIN );
          }
          else if ( ndkArchitecture.startsWith( "x86" ) )
          {
              resolvedNdkToolchain = resolveNdkToolchain( X86_TOOLCHAIN );
          }
          else if ( ndkArchitecture.startsWith( "mips64" ) )
          {
              resolvedNdkToolchain = resolveNdkToolchain( MIPS64_TOOLCHAIN );
          }
          else if ( ndkArchitecture.startsWith( "mips" ) )
          {
              resolvedNdkToolchain = resolveNdkToolchain( MIPS_TOOLCHAIN );
          }
  
          // if no toolchain can be found
          if ( resolvedNdkToolchain == null )
          {
              throw new MojoExecutionException(
                  "Can not resolve automatically a toolchain to use. Please specify one." );
          }
          return resolvedNdkToolchain;
      }
docs: Tries to resolve the toolchain based on the path of the file.
  
  @param file Native library
  @return String
  @throws MojoExecutionException When no toolchain is found